Package ptolemy.vergil.toolbox
Class AttributeBoundsManipulator
- java.lang.Object
-
- diva.canvas.AbstractFigure
-
- diva.canvas.AbstractFigureContainer
-
- diva.canvas.FigureDecorator
-
- diva.canvas.interactor.Manipulator
-
- diva.canvas.interactor.BoundsManipulator
-
- 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.- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Edward A. Lee
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Red (eal)
-
-
Constructor Summary
Constructors Constructor Description AttributeBoundsManipulator(NamedObj container)
Construct a new bounds manipulator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mousePressed(LayerEvent e)
Make a record of the size before resizing.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.CanvasComponent
getTransformContext
-
Methods inherited from interface diva.canvas.VisibleComponent
isVisible, paint, setVisible
-
-
-
-
Constructor Detail
-
AttributeBoundsManipulator
public AttributeBoundsManipulator(NamedObj container)
Construct a new bounds manipulator.- Parameters:
container
- The container of the icon to be manipulated.
-
-
Method Detail
-
mouseReleased
public void mouseReleased(LayerEvent e)
Make a persistent record of the new size by issuing a change request.- Overrides:
mouseReleased
in classBoundsManipulator
- Parameters:
e
- The mouse event.
-
mousePressed
public void mousePressed(LayerEvent e)
Make a record of the size before resizing.- Overrides:
mousePressed
in classBoundsManipulator
- Parameters:
e
- The mouse event.
-
newInstance
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.- Overrides:
newInstance
in classBoundsManipulator
- Parameters:
f
- The figure- Returns:
- The new instance of the figure decorator.
-
setSnapResolution
public void setSnapResolution(double resolution)
Set the snap resolution.- Parameters:
resolution
- The snap resolution.
-
-