Package org.eclipse.zest.core.widgets
Class GraphItem
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Item
org.eclipse.zest.core.widgets.GraphItem
- Direct Known Subclasses:
GraphConnection
,GraphNode
Provides support for property changes. All model elements extend this class.
Also extends the Item (Widget) class to be used inside a StructuredViewer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkStyle
(int styleToCheck) Checks a style to see if it is set on the given graph itemvoid
dispose()
abstract Graph
Gets the graph that this item is rooted on.abstract int
Gets the graph item type.abstract void
Highlights the current GraphItem.boolean
Get state of highlight of this itemabstract boolean
Get the visibility of this item.abstract void
setVisible
(boolean visible) Set the visibility of this item.abstract void
Unhighlight sets the graphItem (either a graphNode or graphConnection) back to the unhighlight figure or color.Methods inherited from class org.eclipse.swt.widgets.Item
checkSubclass, getImage, getText, setImage, setText
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData, toString
-
Field Details
-
GRAPH
public static final int GRAPH- See Also:
-
NODE
public static final int NODE- See Also:
-
CONNECTION
public static final int CONNECTION- See Also:
-
CONTAINER
public static final int CONTAINER- See Also:
-
-
Constructor Details
-
GraphItem
- Parameters:
parent
-style
-
-
GraphItem
Deprecated, for removal: This API element is subject to removal in a future version.Since Zest 2.0, useGraphItem(Graph, int)
andWidget.setData(Object)
- Parameters:
parent
-style
-
-
-
Method Details
-
dispose
public void dispose() -
getItemType
public abstract int getItemType()Gets the graph item type. The item type is one of: GRAPH, NODE or CONNECTION -
setVisible
public abstract void setVisible(boolean visible) Set the visibility of this item.- Parameters:
visible
- whether or not this item is visible.
-
isVisible
public abstract boolean isVisible()Get the visibility of this item.- Returns:
- the visibility of this item.
-
getGraphModel
Gets the graph that this item is rooted on. If this item is itself a graph, then this is returned.- Returns:
- the parent graph.
-
highlight
public abstract void highlight()Highlights the current GraphItem. A graph item is either a graph node or graph connection, and highlighting them will set the appropriate highlight color. -
unhighlight
public abstract void unhighlight()Unhighlight sets the graphItem (either a graphNode or graphConnection) back to the unhighlight figure or color. -
isHighlighted
public boolean isHighlighted()Get state of highlight of this item- Returns:
- boolean true if item is highlighted
- Since:
- 1.9 (included default impl and not made abstract to not brake downstream)
-
checkStyle
protected boolean checkStyle(int styleToCheck) Checks a style to see if it is set on the given graph item- Parameters:
styleToCheck
- The style to check
-
GraphItem(Graph, int)
andWidget.setData(Object)