JHotDraw 6.0b1

org.jhotdraw.standard
Class AbstractHandle

java.lang.Object
  extended by org.jhotdraw.standard.AbstractHandle
All Implemented Interfaces:
Handle
Direct Known Subclasses:
ChangeConnectionHandle, ElbowHandle, LocatorHandle, PolygonHandle

public abstract class AbstractHandle
extends java.lang.Object
implements Handle

AbstractHandle provides defaulf implementation for the Handle interface.

See Also:
Figure, Handle

Field Summary
static int HANDLESIZE
          The standard size of a handle.
 
Constructor Summary
AbstractHandle(Figure owner)
          Constructor for AbstractHandle.
 
Method Summary
 boolean containsPoint(int x, int y)
          Tests if a point is contained in the handle.
 java.awt.Rectangle displayBox()
          Gets the display box of the handle.
 void draw(java.awt.Graphics g)
          Draws this handle.
 Cursor getCursor()
          Returns the preferred Cursor for this Handle.
 Undoable getUndoActivity()
          Returns an Undoable to be used by the Undo/Redo infrastructure.
 void invokeEnd(int dx, int dy, Drawing drawing)
          Deprecated. As of version 4.1, use invokeEnd(x, y, anchorX, anchorY, drawingView).
 void invokeEnd(int x, int y, int anchorX, int anchorY, DrawingView view)
          Tracks the end of the interaction.
 void invokeStart(int x, int y, Drawing drawing)
          Deprecated. As of version 4.1, use invokeStart(x, y, drawingView)
 void invokeStart(int x, int y, DrawingView view)
          Tracks the start of the interaction.
 void invokeStep(int dx, int dy, Drawing drawing)
          Deprecated. As of version 4.1, use invokeStep(x, y, anchorX, anchorY, drawingView)
 void invokeStep(int x, int y, int anchorX, int anchorY, DrawingView view)
          Tracks a step of the interaction.
 Figure owner()
          Gets the handle's owner.
 void setUndoActivity(Undoable newUndoableActivity)
          Sets an Undoable to be used by the Undo/Redo infrastructure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jhotdraw.framework.Handle
locate
 

Field Detail

HANDLESIZE

public static final int HANDLESIZE
The standard size of a handle.

See Also:
Constant Field Values
Constructor Detail

AbstractHandle

public AbstractHandle(Figure owner)
Constructor for AbstractHandle. Initializes the owner of the figure.

Parameters:
owner -
Method Detail

invokeStart

public void invokeStart(int x,
                        int y,
                        DrawingView view)
Description copied from interface: Handle
Tracks the start of the interaction. The default implementation does nothing.

Specified by:
invokeStart in interface Handle
Parameters:
x - the x position where the interaction started
y - the y position where the interaction started
view - the handles container
See Also:
Handle.invokeStart(int, int, org.jhotdraw.framework.DrawingView)

invokeStart

public void invokeStart(int x,
                        int y,
                        Drawing drawing)
Deprecated. As of version 4.1, use invokeStart(x, y, drawingView)

Tracks the start of the interaction. The default implementation does nothing.

Specified by:
invokeStart in interface Handle
Parameters:
x - the x position where the interaction started
y - the y position where the interaction started
See Also:
Handle.invokeStart(int, int, org.jhotdraw.framework.Drawing)

invokeStep

public void invokeStep(int x,
                       int y,
                       int anchorX,
                       int anchorY,
                       DrawingView view)
Tracks a step of the interaction.

Specified by:
invokeStep in interface Handle
Parameters:
x - the current x position
y - the current y position
anchorX - the x position where the interaction started
anchorY - the y position where the interaction started
See Also:
Handle.invokeStep(int, int, int, int, org.jhotdraw.framework.DrawingView)

invokeStep

public void invokeStep(int dx,
                       int dy,
                       Drawing drawing)
Deprecated. As of version 4.1, use invokeStep(x, y, anchorX, anchorY, drawingView)

Tracks a step of the interaction.

Specified by:
invokeStep in interface Handle
Parameters:
dx - x delta of this step
dy - y delta of this step
See Also:
Handle.invokeStep(int, int, org.jhotdraw.framework.Drawing)

invokeEnd

public void invokeEnd(int x,
                      int y,
                      int anchorX,
                      int anchorY,
                      DrawingView view)
Tracks the end of the interaction.

Specified by:
invokeEnd in interface Handle
Parameters:
x - the current x position
y - the current y position
anchorX - the x position where the interaction started
anchorY - the y position where the interaction started
See Also:
Handle.invokeEnd(int, int, int, int, org.jhotdraw.framework.DrawingView)

invokeEnd

public void invokeEnd(int dx,
                      int dy,
                      Drawing drawing)
Deprecated. As of version 4.1, use invokeEnd(x, y, anchorX, anchorY, drawingView).

Tracks the end of the interaction.

Specified by:
invokeEnd in interface Handle
See Also:
Handle.invokeEnd(int, int, org.jhotdraw.framework.Drawing)

owner

public Figure owner()
Gets the handle's owner.

Specified by:
owner in interface Handle
See Also:
Handle.owner()

displayBox

public java.awt.Rectangle displayBox()
Gets the display box of the handle.

Specified by:
displayBox in interface Handle
See Also:
Handle.displayBox()

containsPoint

public boolean containsPoint(int x,
                             int y)
Tests if a point is contained in the handle.

Specified by:
containsPoint in interface Handle
See Also:
Handle.containsPoint(int, int)

draw

public void draw(java.awt.Graphics g)
Draws this handle.

Specified by:
draw in interface Handle
See Also:
Handle.draw(java.awt.Graphics)

getUndoActivity

public Undoable getUndoActivity()
Description copied from interface: Handle
Returns an Undoable to be used by the Undo/Redo infrastructure.

Specified by:
getUndoActivity in interface Handle
Returns:
Undoable
See Also:
Handle.getUndoActivity()

setUndoActivity

public void setUndoActivity(Undoable newUndoableActivity)
Description copied from interface: Handle
Sets an Undoable to be used by the Undo/Redo infrastructure.

Specified by:
setUndoActivity in interface Handle
See Also:
Handle.setUndoActivity(org.jhotdraw.util.Undoable)

getCursor

public Cursor getCursor()
Description copied from interface: Handle
Returns the preferred Cursor for this Handle.

Specified by:
getCursor in interface Handle
Returns:
Cursor
See Also:
Handle.getCursor()

JHotDraw 6.0b1