|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.ConnectionAnchorBase
org.eclipse.draw2d.AbstractConnectionAnchor
org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor
public class BaseSlidableAnchor
Provides the implementation of Slidable anchor
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.draw2d.AncestorListener |
---|
AncestorListener.Stub |
Field Summary |
---|
Fields inherited from class org.eclipse.draw2d.ConnectionAnchorBase |
---|
listeners |
Constructor Summary | |
---|---|
BaseSlidableAnchor()
Empty constructor |
|
BaseSlidableAnchor(IFigure f)
Default constructor. |
|
BaseSlidableAnchor(IFigure f,
PrecisionPoint p)
Constructor. |
Method Summary | |
---|---|
static PrecisionPoint |
getAnchorRelativeLocation(Point p,
Rectangle bounds)
Calculates the relative location of the reference point with respect to the bounds of the figure. |
protected Rectangle |
getBox()
Gets the anchors associated figure's bounding box in absolute coordinates. |
protected PointList |
getIntersectionPoints(Point ownReference,
Point foreignReference)
Calculates intersection points of the figure and the line that passes through ownReference and foreignReference points |
Point |
getLocation(Point reference)
|
protected Point |
getLocation(Point ownReference,
Point foreignReference)
Calculates the location of the anchor depending on the anchors own reference and foreign reference points |
Point |
getOrthogonalLocation(Point orthoReference)
Determines connection anchor point for Orthogonal connection. |
protected PointList |
getPolygonPoints()
Returns the list of all the vertices of the figure. |
Point |
getReferencePoint()
|
java.lang.String |
getTerminal()
Creates terminal string for slidable anchor |
boolean |
isDefaultAnchor()
Returns true if the SlidableAnchor is default one with a reference at the center |
protected Point |
normalizeToStraightlineTolerance(Point foreignReference,
Point ownReference,
int tolerance)
Returns a new owned reference point that is normalized to be with-in a straight-line tolerance value. |
static PrecisionPoint |
parseTerminalString(java.lang.String terminal)
Parses anchors terminal string and returns the relative reference icorporated in the terminal string |
Methods inherited from class org.eclipse.draw2d.AbstractConnectionAnchor |
---|
addAnchorListener, ancestorAdded, ancestorMoved, ancestorRemoved, getOwner, removeAnchorListener, setOwner |
Methods inherited from class org.eclipse.draw2d.ConnectionAnchorBase |
---|
fireAnchorMoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.draw2d.ConnectionAnchor |
---|
addAnchorListener, getOwner, removeAnchorListener |
Constructor Detail |
---|
public BaseSlidableAnchor()
public BaseSlidableAnchor(IFigure f)
f
- IFigure
that this anchor is associated with.public BaseSlidableAnchor(IFigure f, PrecisionPoint p)
f
- IFigure
that this anchor is associated with.p
- the PrecisionPoint
that the anchor will initially attach to.Method Detail |
---|
public java.lang.String getTerminal()
String
terminal for slidable anchorpublic Point getReferencePoint()
getReferencePoint
in interface ConnectionAnchor
getReferencePoint
in class AbstractConnectionAnchor
protected Point getLocation(Point ownReference, Point foreignReference)
ownReference
- - the own reference of the anchorforeignReference
- - foreign reference that comes in
public Point getLocation(Point reference)
getLocation
in interface ConnectionAnchor
protected Point normalizeToStraightlineTolerance(Point foreignReference, Point ownReference, int tolerance)
foreignReference
- Point
that is the foreign reference point used to calculate
the interfection anchor point on the shape in absolute coordinates.ownReference
- Point
that is the reference point with-in the shape in
absolute coordinatestolerance
- int
value that is the difference in absolute coordinates where the
two points would be considered straight and then adjusted.
Point
that is the normalized owned reference to be with-in a given
straight-line tolerance value of the foreign reference point.protected PointList getIntersectionPoints(Point ownReference, Point foreignReference)
ownReference
- the reference Point
on or inside the shape that is being
anchored to.foreignReference
- the outside reference Point
point that is the terminal
end of the line formed by the two parameters.
protected PointList getPolygonPoints()
PointList
list of all the vertices of the figure.public static PrecisionPoint getAnchorRelativeLocation(Point p, Rectangle bounds)
p
- the Point
that is relative coordinates of the point
PrecisionPoint
, i.e. the relative reference for
SlidableAnchor
protected Rectangle getBox()
Rectangle
that is the bounding box of the owner figure
in absolute coordinatespublic boolean isDefaultAnchor()
SlidableAnchor
is default one with a reference at the center
boolean
true
is the SlidableAnchor
is default one, false
otherwisepublic static PrecisionPoint parseTerminalString(java.lang.String terminal)
terminal
- - the terminal string containing relative reference
public Point getOrthogonalLocation(Point orthoReference)
OrthogonalConnectionAnchor
orthoReference
point to the shape and
shape's edge.
getOrthogonalLocation
in interface OrthogonalConnectionAnchor
orthoReference
- the reference point
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.