Zest
1.5.100.201405261516

org.eclipse.zest.core.widgets
Class GraphItem

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Item
          extended by 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
static int CONNECTION
           
static int CONTAINER
           
static int GRAPH
           
static int NODE
           
 
Constructor Summary
GraphItem(Widget parent, int style)
           
GraphItem(Widget parent, int style, java.lang.Object data)
           
 
Method Summary
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.
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)
Parameters:
parent -
style -
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.

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.


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:

Zest
1.5.100.201405261516

Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.