CH.ifa.draw.standard
Class AbstractHandle

java.lang.Object
  extended by CH.ifa.draw.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)
          Initializes the owner of the figure.
 
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.
 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.
 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)
           
 void invokeStart(int x, int y, DrawingView view)
           
 void invokeStep(int dx, int dy, Drawing drawing)
           
 void invokeStep(int x, int y, int anchorX, int anchorY, DrawingView view)
          Tracks a step of the interaction.
abstract  java.awt.Point locate()
          Locates the handle on the figure.
 Figure owner()
          Gets the handle's owner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)
Initializes the owner of the figure.

Method Detail

locate

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

Specified by:
locate in interface Handle

invokeStart

public void invokeStart(int x,
                        int y,
                        Drawing drawing)
Specified by:
invokeStart in interface Handle
Parameters:
x - the x position where the interaction started
y - the y position where the interaction started

invokeStart

public void invokeStart(int x,
                        int y,
                        DrawingView view)
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

invokeStep

public void invokeStep(int dx,
                       int dy,
                       Drawing drawing)
Specified by:
invokeStep in interface Handle
Parameters:
dx - x delta of this step
dy - y delta of this step

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

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

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

owner

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

Specified by:
owner in interface Handle

displayBox

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

Specified by:
displayBox in interface Handle

containsPoint

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

Specified by:
containsPoint in interface Handle

draw

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

Specified by:
draw in interface Handle