ptolemy.vergil.toolbox
Class AttributeBoundsManipulator

java.lang.Object
  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.

Since:
Ptolemy II 4.0
Version:
$Id: AttributeBoundsManipulator.java 57040 2010-01-27 20:52:32Z cxh $
Author:
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

_instanceDecorator

private FigureDecorator _instanceDecorator

_container

private NamedObj _container

_resizer

private AttributeBoundsManipulator.Resizer _resizer
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 class BoundsManipulator
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 class BoundsManipulator

setSnapResolution

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

Parameters:
resolution - The snap resolution.