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.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.protected org.eclipse.draw2d.geometry.Rectangle
getBox()
Gets the anchors associated figure's bounding box in absolute coordinates.protected org.eclipse.draw2d.geometry.PointList
Returns the list of all the vertices of the figure.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 pointsorg.eclipse.draw2d.geometry.Point
getLocation
(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.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 pointsstatic org.eclipse.draw2d.geometry.Point
pickClosestPoint
(org.eclipse.draw2d.geometry.PointList points, org.eclipse.draw2d.geometry.Point p) Assumption: Points in thePointList
andPoint
p lie on the same line.Methods inherited from class org.eclipse.graphiti.ui.internal.util.draw2d.ChopboxAnchorFixed
getAdvancedAnchor
Methods inherited from class org.eclipse.draw2d.ChopboxAnchor
equals, getReferencePoint, hashCode
Methods inherited from class org.eclipse.draw2d.AbstractConnectionAnchor
addAnchorListener, ancestorAdded, ancestorMoved, ancestorRemoved, getOwner, removeAnchorListener, setOwner
Methods 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:
getBox
in classorg.eclipse.draw2d.ChopboxAnchor
- Returns:
- a
Rectangle
that 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:ChopboxAnchorFixed
CHANGED: 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:
getLocation
in interfaceorg.eclipse.draw2d.ConnectionAnchor
- Overrides:
getLocation
in 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 thePointList
andPoint
p lie on the same line. Returns thePoint
from thePointList
closest 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
Point
from thePointList
closest 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 referencePoint
on or inside the shape that is being anchored to.foreignReference
- the outside referencePoint
point 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
PointList
list 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
- thePoint
that is relative coordinates of the point- Returns:
PrecisionPoint
, i.e. the relative reference forSlidableAnchor
-