Class AttributeBoundsManipulator

  extended by diva.canvas.AbstractFigure
      extended by diva.canvas.AbstractFigureContainer
          extended by diva.canvas.FigureDecorator
              extended by diva.canvas.interactor.Manipulator
                  extended by diva.canvas.interactor.BoundsManipulator
                      extended by ptolemy.vergil.toolbox.AttributeBoundsManipulator
All Implemented Interfaces:
CanvasComponent, Figure, FigureContainer, FigureSet, VisibleComponent, UserObjectContainer

public class AttributeBoundsManipulator
extends BoundsManipulator

This is a bounds manipulator supporting resizable icons. It records the new size when the mouse is released, and supports snap to grid.

Ptolemy II 4.0
$Id: 57040 2010-01-27 20:52:32Z cxh $
Edward A. Lee
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Nested Class Summary
private  class AttributeBoundsManipulator.Resizer
          An interactor class that changes the bounds of the child figure and triggers a repaint.
Field Summary
private  NamedObj _container
private  FigureDecorator _instanceDecorator
private  AttributeBoundsManipulator.Resizer _resizer
Constructor Summary
AttributeBoundsManipulator(NamedObj container)
          Construct a new bounds manipulator.
Method Summary
 void mouseReleased(LayerEvent e)
          Make a persistent record of the new size by issuing a change request.
 FigureDecorator newInstance(Figure f)
          Create a new instance of this manipulator.
 void setSnapResolution(double resolution)
          Set the snap resolution.
Methods inherited from class diva.canvas.interactor.BoundsManipulator
getDragInteractor, getGeometry, refresh, setChild, setDragInteractor
Methods inherited from class diva.canvas.interactor.Manipulator
addGrabHandle, clearGrabHandles, getBounds, getGrabHandleFactory, getHandleInteractor, isRepainting, paint, pick, relocateGrabHandles, removeGrabHandle, repaint, repaint, repaintAlready, setGrabHandleFactory, setHandleFilter, setHandleInteractor, setRepainting
Methods inherited from class diva.canvas.FigureDecorator
add, contains, figures, figuresFromBack, figuresFromFront, getChild, getContainer, getDecoratedFigure, getFigureCount, getShape, hit, remove, replaceChild, transform, translate
Methods inherited from class diva.canvas.AbstractFigureContainer
decorate, pick, undecorate
Methods inherited from class diva.canvas.AbstractFigure
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, intersects, isVisible, paint, setInteractor, setParent, setToolTipText, setUserObject, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface diva.canvas.VisibleComponent
isVisible, paint, setVisible
Methods inherited from interface diva.canvas.CanvasComponent
getParent, getTransformContext

Field Detail


private FigureDecorator _instanceDecorator


private NamedObj _container


private AttributeBoundsManipulator.Resizer _resizer
Constructor Detail


public AttributeBoundsManipulator(NamedObj container)
Construct a new bounds manipulator.

container - The container of the icon to be manipulated.
Method Detail


public void mouseReleased(LayerEvent e)
Make a persistent record of the new size by issuing a change request.

mouseReleased in class BoundsManipulator
e - The mouse event.


public FigureDecorator newInstance(Figure f)
Create a new instance of this manipulator. The new instance will have the same grab handle, and interactor for grab-handles. This is typically called on the prototype to yield a decorator that gets displayed while the object is selected.

newInstance in class BoundsManipulator


public void setSnapResolution(double resolution)
Set the snap resolution.

resolution - The snap resolution.