org.jhotdraw.standard
Class ChangeConnectionHandle

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

public abstract class ChangeConnectionHandle
extends AbstractHandle

ChangeConnectionHandle factors the common code for handles that can be used to reconnect connections.

Version:
<$CURRENT_VERSION$>
See Also:
ChangeConnectionEndHandle, ChangeConnectionStartHandle

Nested Class Summary
static class ChangeConnectionHandle.UndoActivity
           
 
Field Summary
 
Fields inherited from class org.jhotdraw.standard.AbstractHandle
HANDLESIZE
 
Method Summary
 void draw(java.awt.Graphics g)
          Draws this handle.
 void invokeEnd(int x, int y, int anchorX, int anchorY, DrawingView view)
          Connects the figure to the new target.
 void invokeStart(int x, int y, DrawingView view)
          Disconnects the connection.
 void invokeStep(int x, int y, int anchorX, int anchorY, DrawingView view)
          Finds a new target of the connection.
 
Methods inherited from class org.jhotdraw.standard.AbstractHandle
containsPoint, displayBox, getCursor, getUndoActivity, invokeEnd, invokeStart, invokeStep, owner, setUndoActivity
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jhotdraw.framework.Handle
locate
 

Method Detail

invokeStart

public void invokeStart(int x,
                        int y,
                        DrawingView view)
Disconnects the connection.

Specified by:
invokeStart in interface Handle
Overrides:
invokeStart in class AbstractHandle
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)

invokeStep

public void invokeStep(int x,
                       int y,
                       int anchorX,
                       int anchorY,
                       DrawingView view)
Finds a new target of the connection.

Specified by:
invokeStep in interface Handle
Overrides:
invokeStep in class AbstractHandle
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)

invokeEnd

public void invokeEnd(int x,
                      int y,
                      int anchorX,
                      int anchorY,
                      DrawingView view)
Connects the figure to the new target. If there is no new target the connection reverts to its original one.

Specified by:
invokeEnd in interface Handle
Overrides:
invokeEnd in class AbstractHandle
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)

draw

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

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