Package 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,- RoundedRectangleAnchor
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.- 
Nested Class SummaryNested classes/interfaces inherited from interface org.eclipse.draw2d.AncestorListenerAncestorListener.Stub
- 
Field SummaryFields inherited from class org.eclipse.draw2d.ConnectionAnchorBaselisteners
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructs a new ChopboxAnchor.ChopboxAnchor(IFigure owner) Constructs a ChopboxAnchor with the given owner figure.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturnstrueif the other anchor has the same owner and box.protected RectanglegetBox()Returns the bounds of this ChopboxAnchor's owner.getLocation(Point reference) Gets a Rectangle fromgetBox()and returns the Point where a line from the center of the Rectangle to the Point reference intersects the Rectangle.Returns the anchor's reference point.inthashCode()The owning figure's hashcode is used since equality is approximately based on the owner.Methods inherited from class org.eclipse.draw2d.AbstractConnectionAnchoraddAnchorListener, ancestorAdded, ancestorMoved, ancestorRemoved, getOwner, removeAnchorListener, setOwnerMethods inherited from class org.eclipse.draw2d.ConnectionAnchorBasefireAnchorMoved
- 
Constructor Details- 
ChopboxAnchorprotected ChopboxAnchor()Constructs a new ChopboxAnchor.
- 
ChopboxAnchorConstructs a ChopboxAnchor with the given owner figure.- Parameters:
- owner- The owner figure
- Since:
- 2.0
 
 
- 
- 
Method Details- 
getLocationGets a Rectangle fromgetBox()and returns the Point where a line from the center of the Rectangle to the Point reference intersects the Rectangle.- Parameters:
- reference- The reference point
- Returns:
- The anchor location
 
- 
getBoxReturns the bounds of this ChopboxAnchor's owner. Subclasses can override this method to adjust the box the anchor can be placed on. For instance, the owner figure may have a drop shadow that should not be included in the box.- Returns:
- The bounds of this ChopboxAnchor's owner
- Since:
- 2.0
 
- 
getReferencePointReturns the anchor's reference point. In the case of the ChopboxAnchor, this is the center of the anchor's owner.- Specified by:
- getReferencePointin interface- ConnectionAnchor
- Overrides:
- getReferencePointin class- AbstractConnectionAnchor
- Returns:
- The reference point
- See Also:
 
- 
equalsReturnstrueif the other anchor has the same owner and box.
- 
hashCodepublic int hashCode()The owning figure's hashcode is used since equality is approximately based on the owner.
 
-