JHotDraw 6.0b1

org.jhotdraw.framework
Interface Handle

All Known Implementing Classes:
AbstractHandle, ChangeConnectionEndHandle, ChangeConnectionHandle, ChangeConnectionStartHandle, ConnectionHandle, ElbowHandle, FontSizeHandle, LocatorHandle, NullHandle, PolygonHandle, PolyLineHandle, UndoableHandle

public interface Handle

Handles are used to change a figure by direct manipulation. Handles know their owning figure and they provide methods to locate the handle on the figure and to track changes.


Design Patterns

 o Adapter
Handles adapt the operations to manipulate a figure to a common interface.

See Also:
Figure

Field Summary
static int HANDLESIZE
           
 
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.
 java.awt.Point locate()
          Locates the handle on the figure.
 Figure owner()
          Gets the handle's owner.
 void setUndoActivity(Undoable newUndoableActivity)
          Sets an Undoable to be used by the Undo/Redo infrastructure.
 

Field Detail

HANDLESIZE

static final int HANDLESIZE
See Also:
Constant Field Values
Method Detail

locate

java.awt.Point locate()
Locates the handle on the figure. The handle is drawn centered around the returned point.


invokeStart

void invokeStart(int x,
                 int y,
                 DrawingView view)
Tracks the start of the interaction. The default implementation does nothing.

Parameters:
x - the x position where the interaction started
y - the y position where the interaction started
view - the handles container

invokeStart

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.

Parameters:
x - the x position where the interaction started
y - the y position where the interaction started

invokeStep

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

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

invokeStep

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.

Parameters:
dx - x delta of this step
dy - y delta of this step

invokeEnd

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

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

invokeEnd

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.


owner

Figure owner()
Gets the handle's owner.


displayBox

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


containsPoint

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


draw

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


getUndoActivity

Undoable getUndoActivity()
Returns an Undoable to be used by the Undo/Redo infrastructure.

Returns:
Undoable

setUndoActivity

void setUndoActivity(Undoable newUndoableActivity)
Sets an Undoable to be used by the Undo/Redo infrastructure.

Parameters:
newUndoableActivity -

getCursor

Cursor getCursor()
Returns the preferred Cursor for this Handle.

Returns:
Cursor

JHotDraw 6.0b1