diva.canvas.interactor
Class MoveHandle

java.lang.Object
  extended by diva.canvas.AbstractFigure
      extended by diva.canvas.toolbox.BasicFigure
          extended by diva.canvas.toolbox.BasicRectangle
              extended by diva.canvas.interactor.MoveHandle
All Implemented Interfaces:
CanvasComponent, Figure, GrabHandle, ShapedFigure, VisibleComponent, UserObjectContainer

public class MoveHandle
extends BasicRectangle
implements GrabHandle

A grab-handle that is intended for acting as a "move me" handle. FIXME: This is a hacked-up copy of BasicGrabHandle, I have no idea whether the thing works for anything other than the demo I constructed. -- johnr

Version:
$Id: MoveHandle.java 38798 2005-07-08 20:00:01Z cxh $
Author:
John Reekie, Michael Shilman

Field Summary
private  Site _site
          The site
private  float _size
           
private  double _x
           
private  double _y
           
 
Constructor Summary
MoveHandle(Site s)
          Construct a new grab handle attached to the given site.
 
Method Summary
 Site getSite()
          Get the site that this handle is attached to
 float getSize()
          Get the "size" of the grab-handle.
 void relocate()
          Reposition the grab-handle if necessary
 void setSite(Site s)
          Set the set to which this grab-handle is attached.
 void setSize(float size)
          Set the "size" of the grab-handle.
 void translate(double x, double y)
          Translating a grab-handle moves its parent object, but _doesn't_ move the grab-handle itself.
 
Methods inherited from class diva.canvas.toolbox.BasicFigure
getBounds, getComposite, getDashArray, getFillPaint, getLineWidth, getOrigin, getShape, getStrokePaint, hit, isCentered, paint, setCentered, setComposite, setDashArray, setFillPaint, setLineWidth, setPrototypeShape, setShape, setStroke, setStrokePaint, transform
 
Methods inherited from class diva.canvas.AbstractFigure
contains, getInteractor, getLayer, getParent, getToolTipText, getTransformContext, getUserObject, intersects, isVisible, paint, repaint, repaint, 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.Figure
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getShape, getToolTipText, hit, intersects, setInteractor, setParent, setToolTipText, transform
 
Methods inherited from interface diva.canvas.VisibleComponent
isVisible, paint, paint, setVisible
 
Methods inherited from interface diva.canvas.CanvasComponent
getTransformContext, repaint, repaint
 
Methods inherited from interface diva.util.UserObjectContainer
getUserObject, setUserObject
 

Field Detail

_site

private Site _site
The site


_x

private double _x

_y

private double _y

_size

private float _size
Constructor Detail

MoveHandle

public MoveHandle(Site s)
Construct a new grab handle attached to the given site.

Method Detail

getSite

public Site getSite()
Get the site that this handle is attached to

Specified by:
getSite in interface GrabHandle

getSize

public float getSize()
Get the "size" of the grab-handle. The size is half the length of each side. The default is 4.0.

Specified by:
getSize in interface GrabHandle

relocate

public void relocate()
Reposition the grab-handle if necessary

Specified by:
relocate in interface GrabHandle

setSite

public void setSite(Site s)
Set the set to which this grab-handle is attached.

Specified by:
setSite in interface GrabHandle

setSize

public void setSize(float size)
Set the "size" of the grab-handle. The size is half the length of each side.

Specified by:
setSize in interface GrabHandle

translate

public void translate(double x,
                      double y)
Translating a grab-handle moves its parent object, but _doesn't_ move the grab-handle itself.

Specified by:
translate in interface Figure
Overrides:
translate in class BasicRectangle