org.eclipse.gef4.zest.core.widgets.custom

## Class LabelSubgraph

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

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

    public class LabelSubgraph
    extends FigureSubgraph

A subgraph layout that displays a label showing number of items pruned within it.

Since:
  2.0

### Nested Class Summary

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

`FigureSubgraph.SubgraphFigrueListener`

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

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

### Field Summary

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

`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
Constructor and Description
`LabelSubgraph(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes, org.eclipse.gef4.layout.interfaces.LayoutContext context, Color foregroundColor, Color backgroundColor)`

### Method Summary

Methods
`protected void` `createFigure()` Creates a figure for this subgraph and stores it in `FigureSubgraph.figure`.
`void` `setBackgroundColor(Color color)` Sets the background color of this subgraph's label.
`void` `setForegroundColor(Color color)` Sets the foreground color of this subgraph (that is color of the text on the label).
`protected void` `updateFigure()` Updates the figure stored in `FigureSubgraph.figure` depending on current nodes contained in this subgraph.

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

`addNodes, applyLayoutChanges, dispose, getFigure, getLocation, getPredecessingEntities, getSize, getSuccessingEntities, isGraphEntity, isMovable, refreshLocation, removeNodes, setLocation`

### 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`

### Constructor Detail

#### LabelSubgraph

    public LabelSubgraph(org.eclipse.gef4.layout.interfaces.NodeLayout[] nodes,
                 org.eclipse.gef4.layout.interfaces.LayoutContext context,
                 Color foregroundColor,
                 Color backgroundColor)

### Method Detail

#### setForegroundColor

    public void setForegroundColor(Color color)

Sets the foreground color of this subgraph (that is color of the text on the label).

Parameters:
  `color` - color to set

#### setBackgroundColor

    public void setBackgroundColor(Color color)

Sets the background color of this subgraph's label.

Parameters:
  `color` - color to set

#### createFigure

    protected void createFigure()

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

Specified by:
  `createFigure` in class `FigureSubgraph`

#### updateFigure

    protected void updateFigure()

Description copied from class: `FigureSubgraph`
Updates the figure stored in `FigureSubgraph.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.

Specified by:
  `updateFigure` in class `FigureSubgraph`