Package org.eclipse.zest.core.widgets
Class FigureSubgraph
java.lang.Object
org.eclipse.zest.core.widgets.DefaultSubgraph
org.eclipse.zest.core.widgets.FigureSubgraph
- All Implemented Interfaces:
- EntityLayout,- SubgraphLayout
- Direct Known Subclasses:
- LabelSubgraph,- TriangleSubgraph
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:
- 1.14
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classListens to changes in this subgraph's figure and fires proper event in its layout context.Nested classes/interfaces inherited from class org.eclipse.zest.core.widgets.DefaultSubgraphDefaultSubgraph.DefaultSubgraphFactory, DefaultSubgraph.LabelSubgraphFactory, DefaultSubgraph.PrunedSuccessorsSubgraphFactory, DefaultSubgraph.TriangleSubgraphFactory
- 
Field SummaryFieldsFields inherited from class org.eclipse.zest.core.widgets.DefaultSubgraphcontext, disposed, nodesFields inherited from interface org.eclipse.zest.layouts.interfaces.SubgraphLayoutBOTTOM_UP, LEFT_RIGHT, RIGHT_LEFT, TOP_DOWN
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedFigureSubgraph(NodeLayout[] nodes, LayoutContext context) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddNodes(NodeLayout[] nodes) Adds nodes to this subgraph.protected voidprotected abstract voidCreates a figure for this subgraph and stores it infigure.protected voiddispose()Returns a point laying in the center of this entity.Returns all entities that are direct predecessors of this entity.getSize()Returns all entities that are direct successors of this entity.booleanReturns true if this subgraph is visualized as a particular object on the graph.booleanprotected voidMakes sure that value returned byDefaultSubgraph.getLocation()will be equal to current location of this subgraph.voidremoveNodes(NodeLayout[] nodes) Removes nodes from this subgraph.voidsetLocation(double x, double y) Sets the position of this entity.protected abstract voidUpdates the figure stored infiguredepending on current nodes contained in this subgraph.Methods inherited from class org.eclipse.zest.core.widgets.DefaultSubgraphcountNodes, getItems, getNodes, getPreferredAspectRatio, isDirectionDependant, isResizable, refreshConnectionsVisibility, refreshSize, removeDisposedNodes, setDirection, setSize
- 
Field Details- 
figure
 
- 
- 
Constructor Details- 
FigureSubgraph
 
- 
- 
Method Details- 
createFigureprotected abstract void createFigure()Creates a figure for this subgraph and stores it infigure. This method may not be called right after creation of the subgraph but later when the figure is actually needed (lazy initialization).
- 
updateFigureprotected abstract void updateFigure()Updates the figure stored infiguredepending on current nodes contained in this subgraph. If this method creates a new instance of IFigure, it should remember to add aFigureSubgraph.SubgraphFigrueListenerto it.
- 
getFigure
- 
addNodesAdds nodes to this subgraph. If given nodes already belong to another subgraph, they are first removed from them. All nodes added to this subgraph are moved to the center of the figure (so that collapsing and expanding animation looks cool).- Specified by:
- addNodesin interface- SubgraphLayout
- Overrides:
- addNodesin class- DefaultSubgraph
- Parameters:
- nodes- array of nodes to add
 
- 
removeNodesDescription copied from interface:SubgraphLayoutRemoves nodes from this subgraph.- Specified by:
- removeNodesin interface- SubgraphLayout
- Overrides:
- removeNodesin class- DefaultSubgraph
- Parameters:
- nodes- array of nodes to remove
 
- 
getSuccessingEntitiesDescription copied from interface:EntityLayoutReturns all entities that are direct successors of this entity. Successor entities of an unpruned node N are:- all unpruned successor nodes of node N
- all subgraphs that are GraphEntitiesand contain at least one successor node of node N
 GraphEntityare:- all unpruned nodes that are successor of at least one node from subgraph S
- all subgraphs that are GraphEntitiesand contain at least one node that is a successor of at least one node from subgraph S
 GraphEntitiesan empty array will be returned.
 Entities connected with this node by a bidirectional connection are considered both successors and predecessors. Any subsequent changes to the returned array do not affect this node.- Specified by:
- getSuccessingEntitiesin interface- EntityLayout
- Overrides:
- getSuccessingEntitiesin class- DefaultSubgraph
- Returns:
- array of successors of this node
 
- 
getPredecessingEntitiesDescription copied from interface:EntityLayoutReturns all entities that are direct predecessors of this entity. Predecessor entities of an unpruned node A are:- all unpruned predecessor nodes of node N
- all subgraphs that are GraphEntitiesand contain at least one predecessor node of node N
 GraphEntityare:- all unpruned nodes that are predecessor of at least one node from subgraph S
- all subgraphs that are GraphEntitiesand contain at least one node that is a predecessor of at least one node from subgraph S
 GraphEntitiesan empty array will be returned.
 Entities connected with this node by a bidirectional connection are considered both successors and predecessors. Any subsequent changes to the returned array do not affect this node.- Specified by:
- getPredecessingEntitiesin interface- EntityLayout
- Overrides:
- getPredecessingEntitiesin class- DefaultSubgraph
- Returns:
- array of predecessors of this node
 
- 
getSize- Specified by:
- getSizein interface- EntityLayout
- Overrides:
- getSizein class- DefaultSubgraph
 
- 
getLocationDescription copied from interface:EntityLayoutReturns a point laying in the center of this entity. Any subsequent changes to the returned point won't affect this node.- Specified by:
- getLocationin interface- EntityLayout
- Overrides:
- getLocationin class- DefaultSubgraph
- Returns:
- position of the center of this node
 
- 
setLocationpublic void setLocation(double x, double y) Description copied from interface:EntityLayoutSets the position of this entity. The node will be moved so that it's center is located in the given point.- Specified by:
- setLocationin interface- EntityLayout
- Overrides:
- setLocationin class- DefaultSubgraph
- Parameters:
- x- the x-position
- y- the y-position
 
- 
refreshLocationprotected void refreshLocation()Description copied from class:DefaultSubgraphMakes sure that value returned byDefaultSubgraph.getLocation()will be equal to current location of this subgraph.- Overrides:
- refreshLocationin class- DefaultSubgraph
 
- 
isGraphEntitypublic boolean isGraphEntity()Description copied from interface:SubgraphLayoutReturns true if this subgraph is visualized as a particular object on the graph. If this method returns false, it means that this subgraph will not be visible so all methods related to location, size and direction should be ignored.- Specified by:
- isGraphEntityin interface- SubgraphLayout
- Overrides:
- isGraphEntityin class- DefaultSubgraph
- Returns:
- whether or not this subgraph is a graph entity that should be laid out.
 
- 
isMovablepublic boolean isMovable()- Specified by:
- isMovablein interface- EntityLayout
- Overrides:
- isMovablein class- DefaultSubgraph
 
- 
disposeprotected void dispose()- Overrides:
- disposein class- DefaultSubgraph
 
- 
applyLayoutChangesprotected void applyLayoutChanges()- Overrides:
- applyLayoutChangesin class- DefaultSubgraph
 
 
-