org.eclipse.gef4.zest.core.widgets

## Class DefaultSubgraph

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

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

Direct Known Subclasses:
  FigureSubgraph

    public class DefaultSubgraph
    extends java.lang.Object
    implements org.eclipse.gef4.layout.interfaces.SubgraphLayout

Default implementation of `SubgraphLayout`. Every subgraph added to Zest `GraphWidget` should inherit from this class. The default implementation is very simple. A node pruned to this subgraph is minimized and all connections adjacent to it are made invisible. No additional graphic elements are added to the graph, but subclasses may add them.

Since:
  2.0

### Nested Class Summary

Nested Classes
`static class` `DefaultSubgraph.DefaultSubgraphFactory` Default factory for `DefaultSubgraph`.
`static class` `DefaultSubgraph.LabelSubgraphFactory`
`static class` `DefaultSubgraph.PrunedSuccessorsSubgraphFactory` Factory for `PrunedSuccessorsSubgraph`.
`static class` `DefaultSubgraph.TriangleSubgraphFactory`

### Field Summary

Fields
`protected org.eclipse.gef4.zest.core.widgets.InternalLayoutContext` `context`
`protected boolean` `disposed`
`protected java.util.Set<org.eclipse.gef4.layout.interfaces.NodeLayout>` `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` `DefaultSubgraph(org.eclipse.gef4.layout.interfaces.LayoutContext context2)`

### Method Summary

Methods
`void` `addNodes(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes)`
`protected void` `applyLayoutChanges()`
`int` `countNodes()`
`protected void` `dispose()`
`java.lang.Object[]` `getItems()`
`org.eclipse.gef4.geometry.planar.Point` `getLocation()`
`org.eclipse.gef4.layout.interfaces.NodeLayout[]` `getNodes()`
`org.eclipse.gef4.layout.interfaces.EntityLayout[]` `getPredecessingEntities()`
`double` `getPreferredAspectRatio()`
`java.lang.Object` `getProperty(java.lang.String name)`
`org.eclipse.gef4.geometry.planar.Dimension` `getSize()`
`org.eclipse.gef4.layout.interfaces.EntityLayout[]` `getSuccessingEntities()`
`boolean` `isDirectionDependant()`
`boolean` `isGraphEntity()`
`boolean` `isMovable()`
`boolean` `isResizable()`
`protected void` `refreshConnectionsVisibility(org.eclipse.gef4.layout.interfaces.ConnectionLayout[] connections)`
`protected void` `refreshLocation()` Makes sure that value returned by `getLocation()` will be equal to current location of this subgraph.
`protected void` `refreshSize()` Makes sure that value returned by `getSize()` will be equal to current size of this subgraph.
`void` `removeNodes(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes)`
`void` `setDirection(int direction)`
`void` `setLocation(double x, double y)`
`void` `setProperty(java.lang.String name, java.lang.Object value)`
`void` `setSize(double width, double height)`

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

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

### Field Detail

#### context

    protected final org.eclipse.gef4.zest.core.widgets.InternalLayoutContext context

#### nodes

    protected final java.util.Set<org.eclipse.gef4.layout.interfaces.NodeLayout> nodes

#### disposed

    protected boolean disposed

### Constructor Detail

#### DefaultSubgraph

    protected DefaultSubgraph(org.eclipse.gef4.layout.interfaces.LayoutContext context2)

### Method Detail

#### isGraphEntity

    public boolean isGraphEntity()

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

#### setSize

    public void setSize(double width,
               double height)

Specified by:
  `setSize` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`

#### setLocation

    public void setLocation(double x,
                   double y)

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

#### isResizable

    public boolean isResizable()

Specified by:
  `isResizable` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`

#### isMovable

    public boolean isMovable()

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

#### getSuccessingEntities

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

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

#### getSize

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

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

#### getPreferredAspectRatio

    public double getPreferredAspectRatio()

Specified by:
  `getPreferredAspectRatio` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`

#### getPredecessingEntities

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

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

#### getLocation

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

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

#### isDirectionDependant

    public boolean isDirectionDependant()

Specified by:
  `isDirectionDependant` in interface `org.eclipse.gef4.layout.interfaces.SubgraphLayout`

#### setDirection

    public void setDirection(int direction)

Specified by:
  `setDirection` in interface `org.eclipse.gef4.layout.interfaces.SubgraphLayout`

#### removeNodes

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

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

#### getNodes

    public org.eclipse.gef4.layout.interfaces.NodeLayout[] getNodes()

Specified by:
  `getNodes` in interface `org.eclipse.gef4.layout.interfaces.SubgraphLayout`

#### getItems

    public java.lang.Object[] getItems()

Specified by:
  `getItems` in interface `org.eclipse.gef4.layout.interfaces.EntityLayout`

#### countNodes

    public int countNodes()

Specified by:
  `countNodes` in interface `org.eclipse.gef4.layout.interfaces.SubgraphLayout`

#### addNodes

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

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

#### refreshConnectionsVisibility

    protected void refreshConnectionsVisibility(org.eclipse.gef4.layout.interfaces.ConnectionLayout[] connections)

#### refreshLocation

    protected void refreshLocation()

Makes sure that value returned by `getLocation()` will be equal to current location of this subgraph.

#### refreshSize

    protected void refreshSize()

Makes sure that value returned by `getSize()` will be equal to current size of this subgraph.

#### applyLayoutChanges

    protected void applyLayoutChanges()

#### dispose

    protected void dispose()

#### getProperty

    public java.lang.Object getProperty(java.lang.String name)

Specified by:
  `getProperty` in interface `org.eclipse.gef4.layout.IPropertyStore`

#### setProperty

    public void setProperty(java.lang.String name,
                   java.lang.Object value)

Specified by:
  `setProperty` in interface `org.eclipse.gef4.layout.IPropertyStore`