Class 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 Details

  • Constructor Details

  • 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