org.eclipse.gef4.zest.core.widgets

## Class FigureSubgraph

- java.lang.Object
- - org.eclipse.gef4.zest.core.widgets.DefaultSubgraph
  - - org.eclipse.gef4.zest.core.widgets.FigureSubgraph

All Implemented Interfaces:
  org.eclipse.gef4.layout.interfaces.EntityLayout, org.eclipse.gef4.layout.interfaces.SubgraphLayout, org.eclipse.gef4.layout.IPropertyStore

Direct Known Subclasses:
  LabelSubgraph, TriangleSubgraph

    public abstract class FigureSubgraph
    extends DefaultSubgraph

A subgraph layout that represents a subgraph as a single figure. An entity representing subgraph is not resizable by layout algorithm unless proper methods are redefined in a subclass.

Since:
  2.0

### Nested Class Summary

Nested Classes
`protected class` `FigureSubgraph.SubgraphFigrueListener` Listens to changes in this subgraph's figure and fires proper event in its layout context.

### Nested classes/interfaces inherited from class org.eclipse.gef4.zest.core.widgets.DefaultSubgraph

`DefaultSubgraph.DefaultSubgraphFactory, DefaultSubgraph.LabelSubgraphFactory, DefaultSubgraph.PrunedSuccessorsSubgraphFactory, DefaultSubgraph.TriangleSubgraphFactory`

### Field Summary

Fields
`protected org.eclipse.draw2d.IFigure` `figure`

### Fields inherited from class org.eclipse.gef4.zest.core.widgets.DefaultSubgraph

`context, disposed, nodes`

### Fields inherited from interface org.eclipse.gef4.layout.interfaces.SubgraphLayout

`BOTTOM_UP, LEFT_RIGHT, RIGHT_LEFT, TOP_DOWN`

### Fields inherited from interface org.eclipse.gef4.layout.interfaces.EntityLayout

`LOCATION_PROPERTY, MOVABLE_PROPERTY, SIZE_PROPERTY`

### Constructor Summary

Constructors
`protected` `FigureSubgraph(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes, org.eclipse.gef4.layout.interfaces.LayoutContext context)`

### Method Summary

Methods
`void` `addNodes(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes)` All nodes added to this subgraph are moved to the center of the figure (so that collapsing and expanding animation looks cool).
`protected void` `applyLayoutChanges()`
`protected abstract void` `createFigure()` Creates a figure for this subgraph and stores it in `figure`.
`protected void` `dispose()`
`org.eclipse.draw2d.IFigure` `getFigure()`
`org.eclipse.gef4.geometry.planar.Point` `getLocation()`
`org.eclipse.gef4.layout.interfaces.EntityLayout[]` `getPredecessingEntities()`
`org.eclipse.gef4.geometry.planar.Dimension` `getSize()`
`org.eclipse.gef4.layout.interfaces.EntityLayout[]` `getSuccessingEntities()`
`boolean` `isGraphEntity()`
`boolean` `isMovable()`
`protected void` `refreshLocation()` Makes sure that value returned by `DefaultSubgraph.getLocation()` will be equal to current location of this subgraph.
`void` `removeNodes(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes)`
`void` `setLocation(double x, double y)`
`protected abstract void` `updateFigure()` Updates the figure stored in `figure` depending on current nodes contained in this subgraph.

### Methods inherited from class org.eclipse.gef4.zest.core.widgets.DefaultSubgraph

`countNodes, getItems, getNodes, getPreferredAspectRatio, getProperty, isDirectionDependant, isResizable, refreshConnectionsVisibility, refreshSize, setDirection, setProperty, setSize`

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

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

### Field Detail

#### figure

    protected org.eclipse.draw2d.IFigure figure

### Constructor Detail

#### FigureSubgraph

    protected FigureSubgraph(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes,
                  org.eclipse.gef4.layout.interfaces.LayoutContext context)

### Method Detail

#### createFigure

    protected abstract void createFigure()

Creates a figure for this subgraph and stores it in `figure`. This method may not be called right after creation of the subgraph but later when the figure is actually needed (lazy initialization).

#### updateFigure

    protected abstract void updateFigure()

Updates the figure stored in `figure` depending on current nodes contained in this subgraph. If this method creates a new instance of IFigure, it should remember to add a `FigureSubgraph.SubgraphFigrueListener` to it.

#### getFigure

    public org.eclipse.draw2d.IFigure getFigure()

#### addNodes

    public void addNodes(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes)

All nodes added to this subgraph are moved to the center of the figure (so that collapsing and expanding animation looks cool).

Specified by:
  `addNodes` in interface `org.eclipse.gef4.layout.interfaces.SubgraphLayout`
Overrides:
  `addNodes` in class `DefaultSubgraph`

#### removeNodes

    public void removeNodes(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes)

Specified by:
  `removeNodes` in interface `org.eclipse.gef4.layout.interfaces.SubgraphLayout`
Overrides:
  `removeNodes` in class `DefaultSubgraph`

#### getSuccessingEntities

    public org.eclipse.gef4.layout.interfaces.EntityLayout[] getSuccessingEntities()

Specified by:
  `getSuccessingEntities` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`
Overrides:
  `getSuccessingEntities` in class `DefaultSubgraph`

#### getPredecessingEntities

    public org.eclipse.gef4.layout.interfaces.EntityLayout[] getPredecessingEntities()

Specified by:
  `getPredecessingEntities` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`
Overrides:
  `getPredecessingEntities` in class `DefaultSubgraph`

#### getSize

    public org.eclipse.gef4.geometry.planar.Dimension getSize()

Specified by:
  `getSize` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`
Overrides:
  `getSize` in class `DefaultSubgraph`

#### getLocation

    public org.eclipse.gef4.geometry.planar.Point getLocation()

Specified by:
  `getLocation` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`
Overrides:
  `getLocation` in class `DefaultSubgraph`

#### setLocation

    public void setLocation(double x,
                   double y)

Specified by:
  `setLocation` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`
Overrides:
  `setLocation` in class `DefaultSubgraph`

#### refreshLocation

    protected void refreshLocation()

Description copied from class: `DefaultSubgraph`
Makes sure that value returned by `DefaultSubgraph.getLocation()` will be equal to current location of this subgraph.

Overrides:
  `refreshLocation` in class `DefaultSubgraph`

#### isGraphEntity

    public boolean isGraphEntity()

Specified by:
  `isGraphEntity` in interface `org.eclipse.gef4.layout.interfaces.SubgraphLayout`
Overrides:
  `isGraphEntity` in class `DefaultSubgraph`

#### isMovable

    public boolean isMovable()

Specified by:
  `isMovable` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`
Overrides:
  `isMovable` in class `DefaultSubgraph`

#### dispose

    protected void dispose()

Overrides:
  `dispose` in class `DefaultSubgraph`

#### applyLayoutChanges

    protected void applyLayoutChanges()

Overrides:
  `applyLayoutChanges` in class `DefaultSubgraph`