Interface SubgraphLayout
- All Superinterfaces:
- EntityLayout
- All Known Implementing Classes:
- DefaultSubgraph,- FigureSubgraph,- LabelSubgraph,- TriangleSubgraph
An interface for subgraphs in layout. A subgraph is a set of pruned nodes
 that will be displayed as one element. A subgraph must contain at least one
 node (empty subgraphs will be removed from its context). Every node can
 belong to at most one subgraph.
- Since:
- 2.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intConstant for bottom-up direction.static final intConstant for direction from left to right.SubgraphLayoutstatic final intConstant for direction from right to left.static final intConstant for top-down direction (default).
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddNodes(NodeLayout[] nodes) Adds nodes to this subgraph.intgetNodes()Returns all the nodes belonging to this subgraph.booleanbooleanReturns true if this subgraph is visualized as a particular object on the graph.voidremoveNodes(NodeLayout[] nodes) Removes nodes from this subgraph.voidsetDirection(int direction) Sets the direction of this subgraph (does nothing in case of subgraphs that don't depend on direction)Methods inherited from interface org.eclipse.zest.layouts.interfaces.EntityLayoutgetItems, getLocation, getPredecessingEntities, getPreferredAspectRatio, getSize, getSuccessingEntities, isMovable, isResizable, setLocation, setSize
- 
Field Details- 
TOP_DOWNstatic final int TOP_DOWNConstant for top-down direction (default).- See Also:
 
- 
BOTTOM_UPstatic final int BOTTOM_UPConstant for bottom-up direction.- See Also:
 
- 
LEFT_RIGHTstatic final int LEFT_RIGHTConstant for direction from left to right.SubgraphLayout- See Also:
 
- 
RIGHT_LEFTstatic final int RIGHT_LEFTConstant for direction from right to left.- See Also:
 
 
- 
- 
Method Details- 
getNodesNodeLayout[] getNodes()Returns all the nodes belonging to this subgraph. Replacing elements in the returned array does not affect this subgraph.- Returns:
- array of nodes
 
- 
countNodesint countNodes()- Returns:
- number of nodes pruned into this subgraph
 
- 
addNodesAdds nodes to this subgraph. If given nodes already belong to another subgraph, they are first removed from them.- Parameters:
- nodes- array of nodes to add
 
- 
removeNodesRemoves nodes from this subgraph.- Parameters:
- nodes- array of nodes to remove
 
- 
isGraphEntityboolean isGraphEntity()Returns 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.- Returns:
- whether or not this subgraph is a graph entity that should be laid out.
 
- 
isDirectionDependantboolean isDirectionDependant()- Returns:
- true if this subgraph is visualized differently depending on direction
 
- 
setDirectionvoid setDirection(int direction) Sets the direction of this subgraph (does nothing in case of subgraphs that don't depend on direction)- Parameters:
- direction- one of constants:- TOP_DOWN,- BOTTOM_UP,- LEFT_RIGHT,- RIGHT_LEFT
 
 
-