Draw2D v2.0

org.eclipse.draw2d
Class ChopboxAnchor

java.lang.Object
  |
  +--org.eclipse.draw2d.ConnectionAnchorBase
        |
        +--org.eclipse.draw2d.AbstractConnectionAnchor
              |
              +--org.eclipse.draw2d.ChopboxAnchor
All Implemented Interfaces:
AncestorListener, ConnectionAnchor
Direct Known Subclasses:
LabelAnchor

public class ChopboxAnchor
extends AbstractConnectionAnchor

The ChopboxAnchor's location is found by calculating the intersection of a line drawn from the center point of its owner's box to a reference point on that box. Thus Connections using the ChopBoxAnchor will be oriented such that they point to their owner's center.


Inner classes inherited from class org.eclipse.draw2d.AncestorListener
AncestorListener.Stub
 
Fields inherited from class org.eclipse.draw2d.ConnectionAnchorBase
listeners
 
Constructor Summary
ChopboxAnchor()
           
ChopboxAnchor(IFigure f)
          Constructs a ChopboxAnchor with owner f.
 
Method Summary
protected  Rectangle getBox()
          Returns the bounds of this ChopboxAnchor's owner.
 Point getLocation(Point reference)
          Returns the location where the Connection should be anchored.
 Point getReferencePoint()
          Returns the point which is used as the reference by this AbstractConnectionAnchor.
 
Methods inherited from class org.eclipse.draw2d.AbstractConnectionAnchor
addAnchorListener, ancestorAdded, ancestorMoved, ancestorRemoved, getOwner, removeAnchorListener, setOwner
 
Methods inherited from class org.eclipse.draw2d.ConnectionAnchorBase
fireAnchorMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChopboxAnchor

public ChopboxAnchor()

ChopboxAnchor

public ChopboxAnchor(IFigure f)
Constructs a ChopboxAnchor with owner f.
Since:
2.0
Method Detail

getLocation

public Point getLocation(Point reference)
Description copied from interface: ConnectionAnchor
Returns the location where the Connection should be anchored.

getBox

protected Rectangle getBox()
Returns the bounds of this ChopboxAnchor's owner.
Since:
2.0

getReferencePoint

public Point getReferencePoint()
Description copied from class: AbstractConnectionAnchor
Returns the point which is used as the reference by this AbstractConnectionAnchor. It is generally dependent on the Figure which is the owner of this AbstractConnectionAnchor.
Overrides:
getReferencePoint in class AbstractConnectionAnchor
Following copied from class: org.eclipse.draw2d.AbstractConnectionAnchor
Returns:
The reference point of this anchor.

Draw2D v2.0