org.eclipse.gef4.zest.core.widgets

## Class GraphItem

- java.lang.Object
- - org.eclipse.swt.widgets.Widget
  - - org.eclipse.swt.widgets.Item
    - - org.eclipse.gef4.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
`static int` `CONNECTION`
`static int` `CONTAINER`
`static int` `GRAPH`
`static int` `NODE`

### Constructor Summary

Constructors
`protected` `GraphItem(IContainer parent, int style, java.lang.Object data)`
`` `GraphItem(Widget parent, int style)`
`` `GraphItem(Widget parent, int style, java.lang.Object data)` Deprecated. Since Zest 2.0, use `#GraphItem(GraphWidget, int)` and `Widget.setData(Object)`

### Method Summary

Methods
`protected boolean` `checkStyle(int styleToCheck)` Checks a style to see if it is set on the given graph item
`void` `dispose()`
`abstract GraphWidget` `getGraphWidget()` Gets the graph that this item is rooted on.
`abstract int` `getItemType()` Gets the graph item type.
`abstract void` `highlight()` Highlights the current GraphItem.
`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, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString`

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

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

### Field Detail

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

#### GraphItem

    public GraphItem(Widget parent,
             int style)

Parameters:
  `parent` -
  `style` -

#### GraphItem

    public GraphItem(Widget parent,
             int style,
             java.lang.Object data)

Deprecated. Since Zest 2.0, use `#GraphItem(GraphWidget, int)` and `Widget.setData(Object)`

#### GraphItem

    protected GraphItem(IContainer parent,
             int style,
             java.lang.Object data)

### Method Detail

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

Returns:

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

#### getGraphWidget

    public abstract GraphWidget getGraphWidget()

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.

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