Package org.eclipse.draw2d

# Interface ConnectionAnchor

All Known Implementing Classes:
  `AbstractConnectionAnchor`, `ChopboxAnchor`, `ConnectionAnchorBase`, `EllipseAnchor`, `LabelAnchor`, `RoundedRectangleAnchor`, `XYAnchor`

public interface ConnectionAnchor
An object to which a `Connection` will be anchored. If the ConnectionAnchor moves, the Connection should move with it.

## Method Summary

Modifier and Type
Method
Description
`void`
`addAnchorListener(AnchorListener listener)`
Adds a listener interested in the movement of this ConnectionAnchor.
`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`
`removeAnchorListener(AnchorListener listener)`
Removes the listener.

## Method Details

### addAnchorListener

void addAnchorListener(AnchorListener listener)
Adds a listener interested in the movement of this ConnectionAnchor.

Parameters:
  `listener` - The AnchorListener to be added

### getLocation

Point getLocation(Point reference)
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

IFigure getOwner()
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

Point getReferencePoint()
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

### removeAnchorListener

void removeAnchorListener(AnchorListener listener)
Removes the listener.

Parameters:
  `listener` - The AnchorListener to be removed