|
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 void |
applyTransparency(Graphics g)
Converts transparency value from percent range [0, 100] to alpha range [0, 255] and applies converted value. 0% corresponds to alpha 255 and 100% corresponds to alpha 0. |
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 |
protected void |
fillGradient(Graphics g)
Fills gradient using default mode SWT.FILL_EVEN_ODD and getPath() to obtain path to fill. |
protected void |
fillGradient(Graphics g,
int fillMode)
Fills gradient using getPath() to obtain path to fill. |
protected void |
fillGradient(Graphics g,
Path path)
Fills gradient using default mode SWT.FILL_EVEN_ODD. |
protected void |
fillGradient(Graphics g,
Path path,
int fillMode)
Fills given path by gradient using given fillMode |
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()
|
int |
getGradientColor1()
|
int |
getGradientColor2()
|
int |
getGradientStyle()
|
Rectangle |
getHandleBounds()
|
int |
getLineStyle()
Returns the line style used to outline this shape. |
int |
getLineWidth()
Returns the line width of this shape's outline. |
protected Path |
getPath()
This method creates and returns figure's path. |
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. |
int |
getTransparency()
Returns transparency value (belongs to [0, 100] interval) |
protected boolean |
isDefaultAnchorArea(PrecisionPoint p)
Checks whether the SlidableAnchor belongs to the area where the default anchor
must be created |
boolean |
isUsingGradient()
Utility method that indicates if gradient should be used as a fill style or not. |
protected void |
paintFigure(Graphics graphics)
|
void |
setGradientData(int gradientColor1,
int gradientColor2,
int gradientStyle)
Sets values defining gradient data. |
void |
setIsUsingGradient(boolean b)
Sets the value of isUsingGradient |
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. |
void |
setTransparency(int transparency)
Sets the transparency if the given parameter is in [0, 100] range |
| 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 HandleBoundspublic ConnectionAnchor getConnectionAnchor(java.lang.String terminal)
IAnchorableFigure
getConnectionAnchor in interface IAnchorableFigureterminal - 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 IAnchorableFigurec - 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 IAnchorableFigurep - 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 IAnchorableFigurep - 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 Figureprotected 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 IPolygonAnchorableFigurepublic int getLineStyle()
public int getLineWidth()
public void setLineWidth(int w)
w - the new widthpublic void setLineStyle(int s)
s - the new line stylepublic int getGradientColor1()
public int getGradientColor2()
public int getGradientStyle()
public void setGradientData(int gradientColor1,
int gradientColor2,
int gradientStyle)
gradientColor1 - gradientColor2 - gradientStyle - public boolean isUsingGradient()
public void setIsUsingGradient(boolean b)
b - value for isUsingGradient
protected void fillGradient(Graphics g,
Path path,
int fillMode)
g - The Graphics used to paintpath - Path of shape to be filled with gradientfillMode - One of SWT.FILL_EVEN_ODD and SWT.FILL_WINDINGprotected void fillGradient(Graphics g)
g - The Graphics used to paint
protected void fillGradient(Graphics g,
Path path)
g - The Graphics used to paintpath - Path of shape to be filled with gradient
protected void fillGradient(Graphics g,
int fillMode)
g - The Graphics used to paintfillMode - One of SWT.FILL_EVEN_ODD and SWT.FILL_WINDINGprotected Path getPath()
public int getTransparency()
public void setTransparency(int transparency)
transparency - The transparency to setprotected void applyTransparency(Graphics g)
g - The Graphics used to paint
|
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.