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`

public abstract class GraphItem extends Item
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

Fields
Modifier and Type
Field
Description
`static final int`
`CONNECTION`
`static final int`
`CONTAINER`
`static final int`
`GRAPH`
`static final int`
`NODE`

## Constructor Summary

Constructors
Constructor
Description
`GraphItem(Widget parent, int style)`
`GraphItem(Widget parent, int style, Object data)`
Deprecated, for removal: This API element is subject to removal in a future version.
Since Zest 2.0, use `GraphItem(Graph, int)` and `Widget.setData(Object)`

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`checkStyle(int styleToCheck)`
Checks a style to see if it is set on the given graph item
`void`
`dispose()`
`abstract Graph`
`getGraphModel()`
Gets the graph that this item is rooted on.
`abstract int`
`getItemType()`
Gets the graph item type.
`abstract void`
`highlight()`
Highlights the current GraphItem.
`boolean`
`isHighlighted()`
Get state of highlight of this item
`abstract boolean`
`isVisible()`
Get the visibility of this item.
`abstract void`
`setVisible(boolean visible)`
Set the visibility of this item.
`abstract void`
`unhighlight()`
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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### GRAPH

public static final int GRAPH

See Also:
  - Constant Field Values

### NODE

public static final int NODE

See Also:
  - Constant Field Values

### CONNECTION

public static final int CONNECTION

See Also:
  - Constant Field Values

### CONTAINER

public static final int CONTAINER

See Also:
  - Constant Field Values

## Constructor Details

### GraphItem

public GraphItem(Widget parent, int style)

Parameters:
  `parent` -
  `style` -

### GraphItem

@Deprecated(since="1.12", forRemoval=true) public GraphItem(Widget parent, int style, Object data)
Deprecated, for removal: This API element is subject to removal in a future version.
Since Zest 2.0, use `GraphItem(Graph, int)` and `Widget.setData(Object)`

Parameters:
  `parent` -
  `style` -

## Method Details

### dispose

public void dispose()

Overrides:
  `dispose` in class `Widget`

### 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

public abstract Graph 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