CH.ifa.draw.standard
Class ChangeConnectionHandle

java.lang.Object
  extended by CH.ifa.draw.standard.AbstractHandle
      extended by CH.ifa.draw.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.

See Also:
ChangeConnectionEndHandle, ChangeConnectionStartHandle

Field Summary
protected  ConnectionFigure fConnection
           
protected  Connector fOriginalTarget
           
protected  java.awt.Point fStart
           
protected  Figure fTarget
           
 
Fields inherited from class CH.ifa.draw.standard.AbstractHandle
HANDLESIZE
 
Constructor Summary
protected ChangeConnectionHandle(Figure owner)
          Initializes the change connection handle.
 
Method Summary
protected abstract  void connect(Connector c)
          Connect the connection with the given figure.
protected abstract  void disconnect()
          Disconnects the connection.
 void draw(java.awt.Graphics g)
          Draws this handle.
protected  Connector findConnector(int x, int y, Figure f)
           
 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.
protected abstract  void setPoint(int x, int y)
          Sets the location of the target point.
protected  Connector source()
          Gets the side of the connection that is unaffected by the change.
protected abstract  Connector target()
          Returns the target connector of the change.
 
Methods inherited from class CH.ifa.draw.standard.AbstractHandle
containsPoint, displayBox, invokeEnd, invokeStart, invokeStep, locate, owner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fOriginalTarget

protected Connector fOriginalTarget

fTarget

protected Figure fTarget

fConnection

protected ConnectionFigure fConnection

fStart

protected java.awt.Point fStart
Constructor Detail

ChangeConnectionHandle

protected ChangeConnectionHandle(Figure owner)
Initializes the change connection handle.

Method Detail

target

protected abstract Connector target()
Returns the target connector of the change.


disconnect

protected abstract void disconnect()
Disconnects the connection.


connect

protected abstract void connect(Connector c)
Connect the connection with the given figure.


setPoint

protected abstract void setPoint(int x,
                                 int y)
Sets the location of the target point.


source

protected Connector source()
Gets the side of the connection that is unaffected by the change.


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

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

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

findConnector

protected Connector findConnector(int x,
                                  int y,
                                  Figure f)

draw

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

Specified by:
draw in interface Handle
Overrides:
draw in class AbstractHandle