Eclipse Draw2d
2.1

org.eclipse.draw2d
Class XYAnchor

java.lang.Object
  |
  +--org.eclipse.draw2d.ConnectionAnchorBase
        |
        +--org.eclipse.draw2d.XYAnchor
All Implemented Interfaces:
ConnectionAnchor

public class XYAnchor
extends ConnectionAnchorBase

Supports an anchor in the XY layout. This anchor exists independently without an owner.


Field Summary
 
Fields inherited from class org.eclipse.draw2d.ConnectionAnchorBase
listeners
 
Constructor Summary
XYAnchor(Point p)
          Constructs an XYAnchor at the Point p.
 
Method Summary
 Point getLocation(Point reference)
          Returns the location where the Connection should be anchored in absolute coordinates.
 IFigure getOwner()
          Returns the IFigure that contains this ConnectionAnchor.
 Point getReferencePoint()
          Returns the reference point for this anchor in absolute coordinates.
 void setLocation(Point p)
          Sets the location of this anchor, and notifies all the listeners of the update.
 
Methods inherited from class org.eclipse.draw2d.ConnectionAnchorBase
addAnchorListener, fireAnchorMoved, removeAnchorListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XYAnchor

public XYAnchor(Point p)
Constructs an XYAnchor at the Point p.

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 in absolute coordinates. The anchor may use the given reference Point to calculate this location.

Parameters:
reference - The reference Point in absolute coordinates
Returns:
The anchor's location

getOwner

public IFigure getOwner()
Description copied from interface: ConnectionAnchor
Returns the IFigure that contains this ConnectionAnchor. Moving this figure will cause the anchor to move with it.

Returns:
The IFigure that contains this ConnectionAnchor

getReferencePoint

public Point getReferencePoint()
Description copied from interface: ConnectionAnchor
Returns the reference point for this anchor in absolute coordinates. This might be used by another anchor to determine its own location (i.e. ChopboxAnchor).

Returns:
The reference Point

setLocation

public void setLocation(Point p)
Sets the location of this anchor, and notifies all the listeners of the update.

Parameters:
p - The new location of this anchor.
Since:
2.0
See Also:
getLocation(Point)

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.