Class GraphContainer

All Implemented Interfaces:
IContainer, IContainer2

public class GraphContainer extends GraphNode implements IContainer2
A Container than can be added to a Graph. Nodes can be added to this container. The container supports collapsing and expanding and has the same properties as the nodes. Containers cannot have custom figures.
  • Field Details

    • zestLayer

      public org.eclipse.zest.core.widgets.internal.ZestRootLayer zestLayer
  • Constructor Details

  • Method Details

    • setCustomFigure

      public void setCustomFigure(IFigure nodeFigure)
      Custom figures cannot be set on a GraphContainer.
    • getNodeFigure

      public IFigure getNodeFigure()
      Description copied from class: GraphNode
      Returns the figure of the whole node.
      Overrides:
      getNodeFigure in class GraphNode
      Returns:
      nodeFigure
    • close

      public void close(boolean animate)
      Close this node.
      Parameters:
      animate -
    • open

      public void open(boolean animate)
      Open the container. This opens the graph container to show the nodes within and update the twistie
    • getGraph

      public Graph getGraph()
      Gets the graph that this container has been added to.
      Specified by:
      getGraph in interface IContainer
    • getItem

      public Widget getItem()
      Specified by:
      getItem in interface IContainer2
    • getItemType

      public int getItemType()
      Description copied from class: GraphItem
      Gets the graph item type. The item type is one of: GRAPH, NODE or CONNECTION
      Specified by:
      getItemType in interface IContainer
      Overrides:
      getItemType in class GraphNode
    • setLayoutAlgorithm

      public void setLayoutAlgorithm(LayoutAlgorithm algorithm, boolean applyLayout)
      Description copied from interface: IContainer
      Sets the LayoutAlgorithm for this container and optionally applies it.
      Specified by:
      setLayoutAlgorithm in interface IContainer
      Parameters:
      algorithm - The layout algorithm to set
      applyLayout -
    • getLayoutAlgorithm

      public LayoutAlgorithm getLayoutAlgorithm()
      Since:
      1.10
    • getLayoutContext

      public final LayoutContext getLayoutContext()
      Specified by:
      getLayoutContext in interface IContainer2
      @noreference
      This method is not intended to be referenced by clients.
    • getLayoutBounds

      public DisplayIndependentRectangle getLayoutBounds()
      Specified by:
      getLayoutBounds in interface IContainer2
      Since:
      1.12
    • applyLayout

      public void applyLayout()
      Description copied from interface: IContainer
      Re-applies the current layout algorithm
      Specified by:
      applyLayout in interface IContainer
    • getScale

      public double getScale()
      Get the scale for this container. This is the scale applied to the children contained within
    • setScale

      public void setScale(double scale)
      Set the scale for this container. This is the scale applied to the children contained within.
      Parameters:
      scale -
    • getHideContainerBounds

      protected Rectangle getHideContainerBounds()
      Overrides:
      getHideContainerBounds in class GraphNode
    • initFigure

      protected void initFigure()
      NON API MEMBERS
      Overrides:
      initFigure in class GraphNode
    • updateFigureForModel

      protected void updateFigureForModel(IFigure currentFigure)
      Overrides:
      updateFigureForModel in class GraphNode
    • refreshLocation

      protected void refreshLocation()
      Overrides:
      refreshLocation in class GraphNode
    • addSubgraphFigure

      public void addSubgraphFigure(IFigure figure)
      Specified by:
      addSubgraphFigure in interface IContainer2
      Parameters:
      figure -
      @noreference
      This method is not intended to be referenced by clients.
    • addNode

      public void addNode(GraphNode node)
      Specified by:
      addNode in interface IContainer2
      Parameters:
      node -
      @noreference
      This method is not intended to be referenced by clients.
    • getNodes

      public List<GraphNode> getNodes()
      Specified by:
      getNodes in interface IContainer
    • getConnections

      public List<GraphConnection> getConnections()
      Description copied from interface: IContainer2
      Returns list of connections laying inside this container. Only connections which both source and target nodes lay directly in this container are returned.
      Specified by:
      getConnections in interface IContainer2
      Since:
      1.12