|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.Figure
org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure
public class NodeFigure
Base class that most shape figures should extend from to gain default connection anchor behavior.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure |
---|
Figure.FigureIterator, Figure.IdentitySearch |
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure |
---|
IFigure.NoInsets |
Field Summary | |
---|---|
static java.lang.String |
szAnchor
String that is the identifier for the default anchor |
Fields inherited from class org.eclipse.draw2d.Figure |
---|
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip |
Fields inherited from interface org.eclipse.draw2d.IFigure |
---|
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS |
Constructor Summary | |
---|---|
NodeFigure()
Constructor - sets the default colors for all node figures. |
Method Summary | |
---|---|
protected ConnectionAnchor |
createAnchor(PrecisionPoint p)
Creates a slidable anchor at the specified point (from the ratio of the reference's coordinates and bounds of the figure |
protected ConnectionAnchor |
createConnectionAnchor(Point p)
Returns a new anchor for this node figure. |
protected ConnectionAnchor |
createDefaultAnchor()
Creates the default Slidable anchor with a reference point at the center of the figure's bounds |
ConnectionAnchor |
getConnectionAnchor(java.lang.String terminal)
Given a string identifier, return the associated anchor for that identifier |
protected java.util.Hashtable |
getConnectionAnchors()
Returns the connectionAnchors. |
java.lang.String |
getConnectionAnchorTerminal(ConnectionAnchor c)
Dynamically allocates a new anchor if needed. |
static java.lang.String |
getDefaultAnchorID()
|
Rectangle |
getHandleBounds()
|
int |
getLineStyle()
Returns the line style used to outline this shape. |
int |
getLineWidth()
Returns the line width of this shape's outline. |
PointList |
getPolygonPoints()
This method allows the implementing class to return a list of points that represent the polygon to be connected to. |
protected double |
getSlidableAnchorArea()
Specifies how large the area of the figure's bounds where SlidableAnchor
will be created. |
ConnectionAnchor |
getSourceConnectionAnchorAt(Point p)
Gets the source connection anchor at a given point on the figure. |
ConnectionAnchor |
getTargetConnectionAnchorAt(Point p)
Gets the target connection anchor at a given point on the figure. |
protected boolean |
isDefaultAnchorArea(PrecisionPoint p)
Checks whether the SlidableAnchor belongs to the area where the default anchor
must be created |
protected void |
paintFigure(Graphics graphics)
|
void |
setLineStyle(int s)
Sets the style of line to be used by this shape. |
void |
setLineWidth(int w)
Sets the line width to be used to outline the shape. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String szAnchor
String
that is the identifier for the default anchor
Constructor Detail |
---|
public NodeFigure()
Method Detail |
---|
public Rectangle getHandleBounds()
getHandleBounds
in interface HandleBounds
public ConnectionAnchor getConnectionAnchor(java.lang.String terminal)
IAnchorableFigure
getConnectionAnchor
in interface IAnchorableFigure
terminal
- String
identifier associated with the anchor
ConnectionAnchor
that is associated with the given string.public java.lang.String getConnectionAnchorTerminal(ConnectionAnchor c)
IAnchorableFigure
getConnectionAnchorTerminal
in interface IAnchorableFigure
c
- the ConnectionAnchor
reference to an anchor associated with the
given point on the figure
String
that represents the anchor identifier.public ConnectionAnchor getSourceConnectionAnchorAt(Point p)
IAnchorableFigure
getSourceConnectionAnchorAt
in interface IAnchorableFigure
p
- Point
on the figure that gives a hint which anchor to return.
ConnectionAnchor
reference to an anchor associated with the given
point on the figure.public ConnectionAnchor getTargetConnectionAnchorAt(Point p)
IAnchorableFigure
getTargetConnectionAnchorAt
in interface IAnchorableFigure
p
- Point
on the figure that gives a hint which anchor to return.
ConnectionAnchor
reference to an anchor associated with the
given point on the figure.protected ConnectionAnchor createConnectionAnchor(Point p)
p
- Point
on the figure that gives a hint which anchor to return.
ConnectionAnchor
reference to an anchor associated with the
given point on the figure.protected boolean isDefaultAnchorArea(PrecisionPoint p)
SlidableAnchor
belongs to the area where the default anchor
must be created
p
-
boolean
true
if false
otherwiseprotected void paintFigure(Graphics graphics)
paintFigure
in class Figure
protected java.util.Hashtable getConnectionAnchors()
protected double getSlidableAnchorArea()
SlidableAnchor
will be created. The result number: 0<=result<=1
protected ConnectionAnchor createDefaultAnchor()
protected ConnectionAnchor createAnchor(PrecisionPoint p)
p
- - relative reference for the SlidableAnchor
SlidableAnchor
for this figure with relative reference at ppublic static java.lang.String getDefaultAnchorID()
String
that is the identifier for the default anchorpublic PointList getPolygonPoints()
IPolygonAnchorableFigure
getPolygonPoints
in interface IPolygonAnchorableFigure
public int getLineStyle()
public int getLineWidth()
public void setLineWidth(int w)
w
- the new widthpublic void setLineStyle(int s)
s
- the new line style
|
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.