Package org.eclipse.zest.core.widgets.custom

# Class LabelSubgraph

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

All Implemented Interfaces:
  `EntityLayout`, `SubgraphLayout`

public class LabelSubgraph extends FigureSubgraph
A subgraph layout that displays a label showing number of items pruned within it.

Since:
  1.14

## Nested Class Summary

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

`FigureSubgraph.SubgraphFigrueListener`

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

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

## Field Summary

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

`figure`

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

`context, disposed, nodes`

### Fields inherited from interface org.eclipse.zest.layouts.interfaces.SubgraphLayout

`BOTTOM_UP, LEFT_RIGHT, RIGHT_LEFT, TOP_DOWN`

## Constructor Summary

Constructors
Constructor
Description
`LabelSubgraph(NodeLayout[] nodes, LayoutContext context, Color foregroundColor, Color backgroundColor)`

## Method Summary

Modifier and Type
Method
Description
`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.zest.core.widgets.FigureSubgraph

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

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

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

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

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

## Constructor Details

### LabelSubgraph

public LabelSubgraph(NodeLayout[] nodes, LayoutContext context, Color foregroundColor, Color backgroundColor)

## Method Details

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