Package org.eclipse.zest.core.widgets
Class GraphNode
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Item
org.eclipse.zest.core.widgets.GraphItem
org.eclipse.zest.core.widgets.GraphNode
- Direct Known Subclasses:
- CGraphNode,- GraphContainer
Simple node class which has the following properties: color, size, location,
 and a label. It also has a list of connections and anchors.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Graphstatic final intstatic final intprotected intprotected ObjectThe internal node.protected IFigureprotected IContainerprotected DimensionFields inherited from class org.eclipse.zest.core.widgets.GraphItemCONNECTION, CONTAINER, GRAPH, NODE
- 
Constructor SummaryConstructorsConstructorDescriptionGraphNode(IContainer graphModel, int style) GraphNode(IContainer graphModel, int style, Object data) Deprecated, for removal: This API element is subject to removal in a future version.GraphNode(IContainer graphModel, int style, String text) Deprecated, for removal: This API element is subject to removal in a future version.Since Zest 2.0, useGraphNode(IContainer, int)andsetText(String)GraphNode(IContainer graphModel, int style, String text, Object data) Deprecated, for removal: This API element is subject to removal in a future version.Since Zest 2.0, useGraphNode(IContainer, int, IFigure)andsetText(String)GraphNode(IContainer graphModel, int style, String text, Image image) Deprecated, for removal: This API element is subject to removal in a future version.GraphNode(IContainer graphModel, int style, String text, Image image, Object data) Deprecated, for removal: This API element is subject to removal in a future version.GraphNode(IContainer graphModel, int style, IFigure data) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanprotected IFigurevoiddispose()protected IFigurefishEye(boolean enable, boolean animate) Get the background colour for this node.Returns if the nodes adjacent to this node will be highlighted when this node is selected.intgetFont()Get the foreground colour for this nodeGets the graphModel that this node is contained inprotected RectangleGet the highlight colour for this nodeintGets the graph item type.org.eclipse.zest.core.widgets.InternalNodeLayoutDeprecated, for removal: This API element is subject to removal in a future version.Not used in Zest 2.x.Returns a copy of the node's location.Returns the figure of the whole node.intgetSize()Returns a copy of the node's size.List<? extends GraphConnection> Returns a new list of the source connections (GraphModelConnection objects).intgetStyle()List<? extends GraphConnection> Returns a new list of the target connections (GraphModelConnection objects).Gets the current tooltip for this node.voidHighlights the node changing the background color and border color.protected voidprotected voidinitModel(IContainer parent, String text, Image image) booleanbooleanreturns true if node is highlighted, false otherwisebooleanbooleanDetermines if this node has a fixed size or if it is packed to the size of its contents.booleanGet the visibility of this item.protected voidvoidPermanently sets the background color (unhighlighted).voidSets the border color.voidSets the highlighted border color.voidsetBorderWidth(int width) voidsetCacheLabel(boolean cacheLabel) voidvoidSet the foreground colour for this nodevoidsetHideNodeHelper(HideNodeHelper hideNodeHelper) voidSet the highlight colour for this nodevoidvoidsetLocation(double x, double y) Sets the current location for this node.voidsetModelFigure(IFigure figure) voidsetNodeStyle(int nodeStyle) voidsetSize(double width, double height) voidvoidsetTooltip(IFigure tooltip) Sets the tooltip on this node.voidsetVisible(boolean visible) Set the visibility of this item.toString()A simple toString that we can use for debuggingvoidRestores the nodes original background color and border width.protected voidupdateFigureForModel(IFigure currentFigure) Methods inherited from class org.eclipse.zest.core.widgets.GraphItemcheckStyleMethods inherited from class org.eclipse.swt.widgets.ItemcheckSubclass, getImage, getTextMethods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, addTypedListener, checkWidget, getData, getData, getDisplay, getListeners, getTypedListeners, isAutoDirection, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData
- 
Field Details- 
HIGHLIGHT_NONEpublic static final int HIGHLIGHT_NONE- See Also:
 
- 
HIGHLIGHT_ONpublic static final int HIGHLIGHT_ON- See Also:
 
- 
size
- 
graph
- 
parent
- 
internalNodeThe internal node.
- 
highlightedprotected int highlighted
- 
nodeFigure
 
- 
- 
Constructor Details- 
GraphNode
- 
GraphNode@Deprecated(since="1.12", forRemoval=true) public GraphNode(IContainer graphModel, int style, Object data) Deprecated, for removal: This API element is subject to removal in a future version.Since Zest 2.0, useGraphNode(IContainer, int, IFigure)instead.
- 
GraphNode- Since:
- 1.14
 
- 
GraphNode@Deprecated(since="1.12", forRemoval=true) public GraphNode(IContainer graphModel, int style, String text) Deprecated, for removal: This API element is subject to removal in a future version.Since Zest 2.0, useGraphNode(IContainer, int)andsetText(String)
- 
GraphNode@Deprecated(since="1.12", forRemoval=true) public GraphNode(IContainer graphModel, int style, String text, Object data) Deprecated, for removal: This API element is subject to removal in a future version.Since Zest 2.0, useGraphNode(IContainer, int, IFigure)andsetText(String)
- 
GraphNode@Deprecated(since="1.12", forRemoval=true) public GraphNode(IContainer graphModel, int style, String text, Image image) Deprecated, for removal: This API element is subject to removal in a future version.
- 
GraphNode@Deprecated(since="1.12", forRemoval=true) public GraphNode(IContainer graphModel, int style, String text, Image image, Object data) Deprecated, for removal: This API element is subject to removal in a future version.
 
- 
- 
Method Details- 
initFigureprotected void initFigure()
- 
initModel
- 
toStringA simple toString that we can use for debugging
- 
getLayoutEntityDeprecated, for removal: This API element is subject to removal in a future version.Not used in Zest 2.x. This class will be removed in a future release.- @nooverride
- This method is not intended to be re-implemented or extended by clients.
- @noreference
- This method is not intended to be referenced by clients.
 
- 
disposepublic void dispose()
- 
isDisposedpublic boolean isDisposed()- Overrides:
- isDisposedin class- Widget
 
- 
isSizeFixedpublic boolean isSizeFixed()Determines if this node has a fixed size or if it is packed to the size of its contents. To set a node to pack, set its size (-1, -1)
- 
getSourceConnectionsReturns a new list of the source connections (GraphModelConnection objects).- Returns:
- List a new list of GraphModelConnect objects
 
- 
getTargetConnectionsReturns a new list of the target connections (GraphModelConnection objects).- Returns:
- List a new list of GraphModelConnect objects
 
- 
getLocationReturns a copy of the node's location.- Returns:
- Point
 
- 
isSelectedpublic boolean isSelected()
- 
setLocationpublic void setLocation(double x, double y) Sets the current location for this node.
- 
getSizeReturns a copy of the node's size.- Returns:
- Dimension
 
- 
getForegroundColorGet the foreground colour for this node
- 
setForegroundColorSet the foreground colour for this node
- 
getBackgroundColorGet the background colour for this node. This is the color the node will be if it is not currently highlighted. This color is meaningless if a custom figure has been set.
- 
setBackgroundColorPermanently sets the background color (unhighlighted). This color has no effect if a custom figure has been set.- Parameters:
- c-
 
- 
setTooltipSets the tooltip on this node. This tooltip will display if the mouse hovers over the node. Setting the tooltip has no effect if a custom figure has been set.
- 
getTooltipGets the current tooltip for this node. The tooltip returned is meaningless if a custom figure has been set.
- 
setBorderColorSets the border color.- Parameters:
- c- the border color.
 
- 
setBorderHighlightColorSets the highlighted border color.- Parameters:
- c- the highlighted border color.
 
- 
getHighlightColorGet the highlight colour for this node
- 
setHighlightColorSet the highlight colour for this node
- 
highlightpublic void highlight()Highlights the node changing the background color and border color. The source and destination connections are also highlighted, and the adjacent nodes are highlighted too in a different color.
- 
unhighlightpublic void unhighlight()Restores the nodes original background color and border width.- Specified by:
- unhighlightin class- GraphItem
 
- 
refreshLocationprotected void refreshLocation()
- 
getBorderColorReturns if the nodes adjacent to this node will be highlighted when this node is selected.- Returns:
- GraphModelNode
 
- 
getBorderWidthpublic int getBorderWidth()
- 
setBorderWidthpublic void setBorderWidth(int width) 
- 
getFont
- 
setFont
- 
setText
- 
setImage
- 
getGraphModelGets the graphModel that this node is contained in- Specified by:
- getGraphModelin class- GraphItem
- Returns:
- The graph model that this node is contained in
 
- 
getNodeStylepublic int getNodeStyle()- Returns:
- the nodeStyle
 
- 
setNodeStylepublic void setNodeStyle(int nodeStyle) - Parameters:
- nodeStyle- the nodeStyle to set
 
- 
setSizepublic void setSize(double width, double height) 
- 
getBorderHighlightColor
- 
cacheLabelpublic boolean cacheLabel()
- 
setCacheLabelpublic void setCacheLabel(boolean cacheLabel) 
- 
getNodeFigureReturns the figure of the whole node.- Returns:
- nodeFigure
 
- 
setVisiblepublic void setVisible(boolean visible) Description copied from class:GraphItemSet the visibility of this item.- Specified by:
- setVisiblein class- GraphItem
- Parameters:
- visible- whether or not this item is visible.
 
- 
setModelFigure- Since:
- 1.8
 
- 
getModelFigure- Since:
- 1.8
 
- 
setHideNodeHelper- Since:
- 1.8
 
- 
getHideNodeHelper- Since:
- 1.8
 
- 
getStylepublic int getStyle()
- 
getHideContainerBounds- Since:
- 1.8
 
- 
fishEye
- 
isHighlightedpublic boolean isHighlighted()returns true if node is highlighted, false otherwise- Overrides:
- isHighlightedin class- GraphItem
- Returns:
- state of highlight
- Since:
- 1.9
 
- 
updateFigureForModel
- 
createFigureForModel
- 
isVisiblepublic boolean isVisible()Description copied from class:GraphItemGet the visibility of this item.
- 
getItemTypepublic int getItemType()Description copied from class:GraphItemGets the graph item type. The item type is one of: GRAPH, NODE or CONNECTION- Specified by:
- getItemTypein class- GraphItem
 
- 
getLayoutpublic org.eclipse.zest.core.widgets.InternalNodeLayout getLayout()- @noreference
- This method is not intended to be referenced by clients.
 
 
- 
GraphNode(IContainer, int, IFigure)instead.