public class EdgeLabelQuery
extends java.lang.Object
| Constructor and Description |
|---|
EdgeLabelQuery(org.eclipse.draw2d.geometry.PointList oldBendPointList,
org.eclipse.draw2d.geometry.PointList newBendPointList,
boolean isEdgeWithObliqueRoutingStyle,
org.eclipse.draw2d.geometry.Point oldLabelOffset,
org.eclipse.draw2d.geometry.Dimension labelSize,
java.lang.Integer keyPoint,
boolean isOnBracketEdge)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.draw2d.geometry.Point |
calculateGMFLabelOffset()
Calculate the new GMF label offset: the label offset defines the position of
the label compared to labelAnchor point.
|
static org.eclipse.draw2d.geometry.Point |
getSnapBackPosition(java.lang.Integer keyPoint)
Return the default snap back position according to the keyPoint of the label.
|
static org.eclipse.draw2d.geometry.Point |
offsetFromRelativeCoordinate(org.eclipse.draw2d.geometry.Point labelCenter,
org.eclipse.draw2d.geometry.PointList points,
org.eclipse.draw2d.geometry.Point ref)
Calculates the label offset from the reference point given the label center
and a points list.
LabelHelper.offsetFromRelativeCoordinate(org.eclipse.draw2d.IFigure, org.eclipse.draw2d.geometry.Rectangle, Point) |
static org.eclipse.draw2d.geometry.Point |
relativeCenterCoordinateFromOffset(org.eclipse.draw2d.geometry.PointList points,
org.eclipse.draw2d.geometry.Point ref,
org.eclipse.draw2d.geometry.Point offset)
Calculates the relative coordinate that is equivalent to the offset from the
reference point, that can be used to set the label center location.
|
public EdgeLabelQuery(org.eclipse.draw2d.geometry.PointList oldBendPointList,
org.eclipse.draw2d.geometry.PointList newBendPointList,
boolean isEdgeWithObliqueRoutingStyle,
org.eclipse.draw2d.geometry.Point oldLabelOffset,
org.eclipse.draw2d.geometry.Dimension labelSize,
java.lang.Integer keyPoint,
boolean isOnBracketEdge)
oldBendPointList - Bendpoint list before the edge modificationnewBendPointList - Bendpoint list after the edge modificationisEdgeWithObliqueRoutingStyle - status of the edge from which to get the previous position of the
bendpoints and from which to get the three labelsoldLabelOffset - The old offset.labelSize - The size of the labelkeyPoint - The keyPoint of the label (
LabelEditPart.getKeyPoint()
)isOnBracketEdge - True if the parent's label is a bracketEdge (specific locator for
center label and possibility to rotate the middle segment), false
otherwise.public static org.eclipse.draw2d.geometry.Point getSnapBackPosition(java.lang.Integer keyPoint)
keyPoint - The keyPoint of the label (
LabelEditPart.getKeyPoint()
).public static org.eclipse.draw2d.geometry.Point offsetFromRelativeCoordinate(org.eclipse.draw2d.geometry.Point labelCenter,
org.eclipse.draw2d.geometry.PointList points,
org.eclipse.draw2d.geometry.Point ref)
LabelHelper.offsetFromRelativeCoordinate(org.eclipse.draw2d.IFigure, org.eclipse.draw2d.geometry.Rectangle, Point)labelCenter - the label center for the IFigure to calculate the
offset forpoints - the PointList of the edge that contains the label.
The label offset is relative to this PointList.ref - the Point that is the reference point that the offset
is based on.Point which represents a value offset from the
ref point oriented based on the nearest line segment.public static org.eclipse.draw2d.geometry.Point relativeCenterCoordinateFromOffset(org.eclipse.draw2d.geometry.PointList points,
org.eclipse.draw2d.geometry.Point ref,
org.eclipse.draw2d.geometry.Point offset)
LabelHelper.relativeCoordinateFromOffset(org.eclipse.draw2d.IFigure, Point, Point)
. See bugzilla 476305 for more detail.points - the PointList of the edge that contains the label.
The label offset is relative to this PointList.ref - a Point located on the parent which the offset value
is relative to.offset - a Point which represents a value offset from the
ref point oriented based on the nearest line segment.Point that is the relative coordinate of the label
that can be used to set it's center location.public org.eclipse.draw2d.geometry.Point calculateGMFLabelOffset()