Package org.eclipse.draw2d
Class AbstractConnectionAnchor
java.lang.Object
org.eclipse.draw2d.ConnectionAnchorBase
org.eclipse.draw2d.AbstractConnectionAnchor
- All Implemented Interfaces:
AncestorListener
,ConnectionAnchor
- Direct Known Subclasses:
ChopboxAnchor
,EllipseAnchor
public abstract class AbstractConnectionAnchor
extends ConnectionAnchorBase
implements AncestorListener
Provides support for anchors which depend on a figure for thier location.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.draw2d.AncestorListener
AncestorListener.Stub
-
Field Summary
Fields inherited from class org.eclipse.draw2d.ConnectionAnchorBase
listeners
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an AbstractConnectionAnchor with no owner.AbstractConnectionAnchor
(IFigure owner) Constructs an AbstractConnectionAnchor with the owner supplied as input. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnchorListener
(AnchorListener listener) Adds the given listener to the listeners to be notified of anchor location changes.void
ancestorAdded
(IFigure ancestor) Called when an ancestor has been added into the listening figure's hierarchy.void
ancestorMoved
(IFigure figure) Notifies all the listeners of this anchor's location change.void
ancestorRemoved
(IFigure ancestor) Called when an ancestor has been removed from the listening figure's hierarchy.getOwner()
Returns the owner Figure on which this anchor's location is dependent.Returns the point which is used as the reference by this AbstractConnectionAnchor.void
removeAnchorListener
(AnchorListener listener) Removes the given listener from this anchor.void
Sets the owner of this anchor, on whom this anchors location is dependent.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
Methods inherited from interface org.eclipse.draw2d.ConnectionAnchor
getLocation
-
Constructor Details
-
AbstractConnectionAnchor
public AbstractConnectionAnchor()Constructs an AbstractConnectionAnchor with no owner.- Since:
- 2.0
-
AbstractConnectionAnchor
Constructs an AbstractConnectionAnchor with the owner supplied as input.- Parameters:
owner
- Owner of this anchor- Since:
- 2.0
-
-
Method Details
-
addAnchorListener
Adds the given listener to the listeners to be notified of anchor location changes.- Specified by:
addAnchorListener
in interfaceConnectionAnchor
- Overrides:
addAnchorListener
in classConnectionAnchorBase
- Parameters:
listener
- Listener to be added- Since:
- 2.0
- See Also:
-
ancestorMoved
Notifies all the listeners of this anchor's location change.- Specified by:
ancestorMoved
in interfaceAncestorListener
- Parameters:
figure
- Anchor-owning Figure which has moved- Since:
- 2.0
- See Also:
-
ancestorAdded
Description copied from interface:AncestorListener
Called when an ancestor has been added into the listening figure's hierarchy.- Specified by:
ancestorAdded
in interfaceAncestorListener
- Parameters:
ancestor
- The ancestor that was added- See Also:
-
ancestorRemoved
Description copied from interface:AncestorListener
Called when an ancestor has been removed from the listening figure's hierarchy.- Specified by:
ancestorRemoved
in interfaceAncestorListener
- Parameters:
ancestor
- The ancestor that has been removed- See Also:
-
getOwner
Returns the owner Figure on which this anchor's location is dependent.- Specified by:
getOwner
in interfaceConnectionAnchor
- Returns:
- Owner of this anchor
- Since:
- 2.0
- See Also:
-
getReferencePoint
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.- Specified by:
getReferencePoint
in interfaceConnectionAnchor
- Returns:
- The reference point of this anchor
- Since:
- 2.0
- See Also:
-
removeAnchorListener
Removes the given listener from this anchor. If all the listeners are removed, then this anchor removes itself from its owner.- Specified by:
removeAnchorListener
in interfaceConnectionAnchor
- Overrides:
removeAnchorListener
in classConnectionAnchorBase
- Parameters:
listener
- Listener to be removed from this anchors listeners list- Since:
- 2.0
- See Also:
-
setOwner
Sets the owner of this anchor, on whom this anchors location is dependent.- Parameters:
owner
- Owner of this anchor- Since:
- 2.0
-