Class GFChopboxAnchor
java.lang.Object
org.eclipse.draw2d.ConnectionAnchorBase
org.eclipse.draw2d.AbstractConnectionAnchor
org.eclipse.draw2d.ChopboxAnchor
org.eclipse.graphiti.ui.internal.util.draw2d.ChopboxAnchorFixed
org.eclipse.graphiti.ui.internal.util.draw2d.GFChopboxAnchor
- All Implemented Interfaces:
org.eclipse.draw2d.AncestorListener,org.eclipse.draw2d.ConnectionAnchor
A chopbox anchor supporting insets
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.draw2d.AncestorListener
org.eclipse.draw2d.AncestorListener.Stub -
Field Summary
Fields inherited from class org.eclipse.draw2d.ConnectionAnchorBase
listeners -
Constructor Summary
ConstructorsConstructorDescriptionGFChopboxAnchor(org.eclipse.draw2d.IFigure figure) GFChopboxAnchor(org.eclipse.draw2d.IFigure figure, AdvancedAnchor advancedAnchor) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.draw2d.geometry.PrecisionPointgetAnchorRelativeLocation(org.eclipse.draw2d.geometry.Point p, org.eclipse.draw2d.geometry.Rectangle bounds) Calculates the relative location of the reference point with respect to the bounds of the figure.protected org.eclipse.draw2d.geometry.RectanglegetBox()Gets the anchors associated figure's bounding box in absolute coordinates.protected org.eclipse.draw2d.geometry.PointListReturns the list of all the vertices of the figure.protected org.eclipse.draw2d.geometry.PointListgetIntersectionPoints(org.eclipse.draw2d.geometry.Point ownReference, org.eclipse.draw2d.geometry.Point foreignReference) Calculates intersection points of the figure and the line that passes through ownReference and foreignReference pointsorg.eclipse.draw2d.geometry.PointgetLocation(org.eclipse.draw2d.geometry.Point reference) CHANGED: if the reference is in the center of the figure, the result was not correct.protected org.eclipse.draw2d.geometry.PointgetLocation(org.eclipse.draw2d.geometry.Point ownReference, org.eclipse.draw2d.geometry.Point foreignReference) Calculates the location of the anchor depending on the anchors own reference and foreign reference pointsstatic org.eclipse.draw2d.geometry.PointpickClosestPoint(org.eclipse.draw2d.geometry.PointList points, org.eclipse.draw2d.geometry.Point p) Assumption: Points in thePointListandPointp lie on the same line.Methods inherited from class org.eclipse.graphiti.ui.internal.util.draw2d.ChopboxAnchorFixed
getAdvancedAnchorMethods inherited from class org.eclipse.draw2d.ChopboxAnchor
equals, getReferencePoint, hashCodeMethods inherited from class org.eclipse.draw2d.AbstractConnectionAnchor
addAnchorListener, ancestorAdded, ancestorMoved, ancestorRemoved, getOwner, removeAnchorListener, setOwnerMethods inherited from class org.eclipse.draw2d.ConnectionAnchorBase
fireAnchorMoved
-
Constructor Details
-
GFChopboxAnchor
public GFChopboxAnchor(org.eclipse.draw2d.IFigure figure) -
GFChopboxAnchor
-
-
Method Details
-
getBox
protected org.eclipse.draw2d.geometry.Rectangle getBox()Gets the anchors associated figure's bounding box in absolute coordinates.- Overrides:
getBoxin classorg.eclipse.draw2d.ChopboxAnchor- Returns:
- a
Rectanglethat is the bounding box of the owner figure in absolute coordinates. also regards the indents
-
getLocation
public org.eclipse.draw2d.geometry.Point getLocation(org.eclipse.draw2d.geometry.Point reference) Description copied from class:ChopboxAnchorFixedCHANGED: if the reference is in the center of the figure, the result was not correct. This method has to be kept in sync withGefService.getChopboxLocationOnBox(Point, Rectangle).- Specified by:
getLocationin interfaceorg.eclipse.draw2d.ConnectionAnchor- Overrides:
getLocationin classChopboxAnchorFixed
-
getLocation
protected org.eclipse.draw2d.geometry.Point getLocation(org.eclipse.draw2d.geometry.Point ownReference, org.eclipse.draw2d.geometry.Point foreignReference) Calculates the location of the anchor depending on the anchors own reference and foreign reference points- Parameters:
ownReference- - the own reference of the anchorforeignReference- - foreign reference that comes in- Returns:
- the location of the anchor depending on the anchors own reference and foreign reference points
-
pickClosestPoint
public static org.eclipse.draw2d.geometry.Point pickClosestPoint(org.eclipse.draw2d.geometry.PointList points, org.eclipse.draw2d.geometry.Point p) Assumption: Points in thePointListandPointp lie on the same line. Returns thePointfrom thePointListclosest to- Parameters:
p-points- - the list of points to select the result fromp- - the point to which the closest point must be foundp-- Returns:
- the
Pointfrom thePointListclosest to
-
getIntersectionPoints
protected org.eclipse.draw2d.geometry.PointList getIntersectionPoints(org.eclipse.draw2d.geometry.Point ownReference, org.eclipse.draw2d.geometry.Point foreignReference) Calculates intersection points of the figure and the line that passes through ownReference and foreignReference points- Parameters:
ownReference- the referencePointon or inside the shape that is being anchored to.foreignReference- the outside referencePointpoint that is the terminal end of the line formed by the two parameters.- Returns:
- intersection points of the figure and the line that passes through ownReference and foreignReference points
-
getClosedPointListOfPointListShape
protected org.eclipse.draw2d.geometry.PointList getClosedPointListOfPointListShape()Returns the list of all the vertices of the figure. The created list must form a polygon, i.e. closed polyline, for figures hence the starting and ending points must be the same- Returns:
- the
PointListlist of all the vertices of the figure.
-
getAnchorRelativeLocation
public static org.eclipse.draw2d.geometry.PrecisionPoint getAnchorRelativeLocation(org.eclipse.draw2d.geometry.Point p, org.eclipse.draw2d.geometry.Rectangle bounds) Calculates the relative location of the reference point with respect to the bounds of the figure. If point p is not inside of the figure's bounds then the point is mapped on the bounds and the point relative location is calculated- Parameters:
p- thePointthat is relative coordinates of the point- Returns:
PrecisionPoint, i.e. the relative reference forSlidableAnchor
-