public class GraphNode extends GraphItem
Modifier and Type | Field and Description |
---|---|
protected Graph |
graph |
static int |
HIGHLIGHT_NONE |
static int |
HIGHLIGHT_ON |
protected int |
highlighted |
protected java.lang.Object |
internalNode
The internal node.
|
protected IFigure |
nodeFigure |
protected IContainer |
parent |
protected Dimension |
size |
CONNECTION, CONTAINER, GRAPH, NODE
Constructor and Description |
---|
GraphNode(IContainer graphModel,
int style) |
GraphNode(IContainer graphModel,
int style,
java.lang.Object data) |
GraphNode(IContainer graphModel,
int style,
java.lang.String text) |
GraphNode(IContainer graphModel,
int style,
java.lang.String text,
Image image) |
GraphNode(IContainer graphModel,
int style,
java.lang.String text,
Image image,
java.lang.Object data) |
GraphNode(IContainer graphModel,
int style,
java.lang.String text,
java.lang.Object data) |
Modifier and Type | Method and Description |
---|---|
boolean |
cacheLabel() |
protected IFigure |
createFigureForModel() |
void |
dispose() |
protected IFigure |
fishEye(boolean enable,
boolean animate) |
Color |
getBackgroundColor()
Get the background colour for this node.
|
Color |
getBorderColor()
Sets if the adjacent nodes to this one should be highlighted when this
node is selected.
|
Color |
getBorderHighlightColor() |
int |
getBorderWidth() |
Font |
getFont() |
Color |
getForegroundColor()
Get the foreground colour for this node
|
Graph |
getGraphModel()
Gets the graphModel that this node is contained in
|
Color |
getHighlightColor()
Get the highlight colour for this node
|
int |
getItemType()
Gets the graph item type.
|
LayoutEntity |
getLayoutEntity() |
Point |
getLocation()
Returns a copy of the node's location.
|
IFigure |
getNodeFigure() |
int |
getNodeStyle() |
Dimension |
getSize()
Returns a copy of the node's size.
|
java.util.List |
getSourceConnections()
Returns a new list of the source connections (GraphModelConnection
objects).
|
int |
getStyle() |
java.util.List |
getTargetConnections()
Returns a new list of the target connections (GraphModelConnection
objects).
|
IFigure |
getTooltip()
Gets the current tooltip for this node.
|
void |
highlight()
Highlights the node changing the background color and border color.
|
protected void |
initFigure() |
protected void |
initModel(IContainer parent,
java.lang.String text,
Image image) |
boolean |
isDisposed() |
boolean |
isSelected() |
boolean |
isSizeFixed()
Determines if this node has a fixed size or if it is packed to the size
of its contents.
|
boolean |
isVisible()
Get the visibility of this item.
|
protected void |
refreshLocation() |
void |
setBackgroundColor(Color c)
Permanently sets the background color (unhighlighted).
|
void |
setBorderColor(Color c)
Sets the border color.
|
void |
setBorderHighlightColor(Color c)
Sets the highlighted border color.
|
void |
setBorderWidth(int width) |
void |
setCacheLabel(boolean cacheLabel) |
void |
setFont(Font font) |
void |
setForegroundColor(Color c)
Set the foreground colour for this node
|
void |
setHighlightColor(Color c)
Set the highlight colour for this node
|
void |
setImage(Image image) |
void |
setLocation(double x,
double y)
Sets the current location for this node.
|
void |
setNodeStyle(int nodeStyle) |
void |
setSize(double width,
double height) |
void |
setText(java.lang.String string) |
void |
setTooltip(IFigure tooltip)
Sets the tooltip on this node.
|
void |
setVisible(boolean visible)
Set the visibility of this item.
|
java.lang.String |
toString()
A simple toString that we can use for debugging
|
void |
unhighlight()
Restores the nodes original background color and border width.
|
protected void |
updateFigureForModel(IFigure currentFigure) |
checkStyle
checkSubclass, getImage, getText
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
public static final int HIGHLIGHT_NONE
public static final int HIGHLIGHT_ON
protected Dimension size
protected Graph graph
protected IContainer parent
protected java.lang.Object internalNode
protected int highlighted
protected IFigure nodeFigure
public GraphNode(IContainer graphModel, int style)
public GraphNode(IContainer graphModel, int style, java.lang.Object data)
public GraphNode(IContainer graphModel, int style, java.lang.String text)
public GraphNode(IContainer graphModel, int style, java.lang.String text, java.lang.Object data)
public GraphNode(IContainer graphModel, int style, java.lang.String text, Image image)
public GraphNode(IContainer graphModel, int style, java.lang.String text, Image image, java.lang.Object data)
protected void initFigure()
protected void initModel(IContainer parent, java.lang.String text, Image image)
public java.lang.String toString()
public LayoutEntity getLayoutEntity()
public boolean isDisposed()
isDisposed
in class Widget
public boolean isSizeFixed()
public java.util.List getSourceConnections()
public java.util.List getTargetConnections()
public Point getLocation()
public boolean isSelected()
public void setLocation(double x, double y)
public Dimension getSize()
public Color getForegroundColor()
public void setForegroundColor(Color c)
public Color getBackgroundColor()
public void setBackgroundColor(Color c)
c
- public void setTooltip(IFigure tooltip)
public IFigure getTooltip()
public void setBorderColor(Color c)
c
- the border color.public void setBorderHighlightColor(Color c)
c
- the highlighted border color.public Color getHighlightColor()
public void setHighlightColor(Color c)
public void highlight()
public void unhighlight()
unhighlight
in class GraphItem
protected void refreshLocation()
public Color getBorderColor()
highlightAdjacentNodes
- The highlightAdjacentNodes to set.public int getBorderWidth()
public void setBorderWidth(int width)
public Font getFont()
public void setFont(Font font)
public Graph getGraphModel()
getGraphModel
in class GraphItem
public int getNodeStyle()
public void setNodeStyle(int nodeStyle)
nodeStyle
- the nodeStyle to setpublic void setSize(double width, double height)
public Color getBorderHighlightColor()
public boolean cacheLabel()
public void setCacheLabel(boolean cacheLabel)
public IFigure getNodeFigure()
public void setVisible(boolean visible)
GraphItem
setVisible
in class GraphItem
visible
- whether or not this item is visible.protected IFigure fishEye(boolean enable, boolean animate)
protected void updateFigureForModel(IFigure currentFigure)
protected IFigure createFigureForModel()
public boolean isVisible()
GraphItem
public int getItemType()
GraphItem
getItemType
in class GraphItem
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.