Package org.eclipse.zest.core.widgets
Class GraphContainer
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Item
org.eclipse.zest.core.widgets.GraphItem
org.eclipse.zest.core.widgets.GraphNode
org.eclipse.zest.core.widgets.GraphContainer
- All Implemented Interfaces:
IContainer,IContainer2
A Container than can be added to a Graph. Nodes can be added to this
container. The container supports collapsing and expanding and has the same
properties as the nodes. Containers cannot have custom figures.
-
Field Summary
FieldsFields inherited from class org.eclipse.zest.core.widgets.GraphNode
graph, HIGHLIGHT_NONE, HIGHLIGHT_ON, highlighted, internalNode, nodeFigure, parent, sizeFields inherited from class org.eclipse.zest.core.widgets.GraphItem
CONNECTION, CONTAINER, GRAPH, NODE -
Constructor Summary
ConstructorsConstructorDescriptionGraphContainer(IContainer graph, int style) Creates a new GraphContainer.GraphContainer(IContainer graph, int style, String text) Deprecated, for removal: This API element is subject to removal in a future version.GraphContainer(IContainer graph, int style, String text, Image image) Deprecated, for removal: This API element is subject to removal in a future version.Since Zest 2.0, useGraphContainer(Graph, int),GraphNode.setText(String), andGraphNode.setImage(Image) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddSubgraphFigure(IFigure figure) voidRe-applies the current layout algorithmvoidclose(boolean animate) Close this node.Returns list of connections laying inside this container.getGraph()Gets the graph that this container has been added to.protected RectanglegetItem()intGets the graph item type.final LayoutContextReturns the figure of the whole node.getNodes()doublegetScale()Get the scale for this container.protected voidNON API MEMBERSvoidopen(boolean animate) Open the container.protected voidvoidsetCustomFigure(IFigure nodeFigure) Custom figures cannot be set on a GraphContainer.voidsetLayoutAlgorithm(LayoutAlgorithm algorithm, boolean applyLayout) Sets the LayoutAlgorithm for this container and optionally applies it.voidsetScale(double scale) Set the scale for this container.protected voidupdateFigureForModel(IFigure currentFigure) Methods inherited from class org.eclipse.zest.core.widgets.GraphNode
cacheLabel, createFigureForModel, dispose, fishEye, getBackgroundColor, getBorderColor, getBorderHighlightColor, getBorderWidth, getFont, getForegroundColor, getGraphModel, getHideNodeHelper, getHighlightColor, getLayout, getLayoutEntity, getLocation, getModelFigure, getNodeStyle, getSize, getSourceConnections, getStyle, getTargetConnections, getTooltip, highlight, initModel, isDisposed, isHighlighted, isSelected, isSizeFixed, isVisible, setBackgroundColor, setBorderColor, setBorderHighlightColor, setBorderWidth, setCacheLabel, setFont, setForegroundColor, setHideNodeHelper, setHighlightColor, setImage, setLocation, setModelFigure, setNodeStyle, setSize, setText, setTooltip, setVisible, toString, unhighlightMethods inherited from class org.eclipse.zest.core.widgets.GraphItem
checkStyleMethods inherited from class org.eclipse.swt.widgets.Item
checkSubclass, getImage, getTextMethods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, getData, getData, getDisplay, getListeners, getTypedListeners, isAutoDirection, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData
-
Field Details
-
zestLayer
public org.eclipse.zest.core.widgets.internal.ZestRootLayer zestLayer
-
-
Constructor Details
-
GraphContainer
Creates a new GraphContainer. A GraphContainer may contain nodes, and has many of the same properties as a graph node.- Parameters:
graph- The graph that the container is being added tostyle-
-
GraphContainer
@Deprecated(since="1.12", forRemoval=true) public GraphContainer(IContainer graph, int style, String text) Deprecated, for removal: This API element is subject to removal in a future version.Since Zest 2.0, useGraphContainer(Graph, int),GraphNode.setText(String) -
GraphContainer
@Deprecated(since="1.12", forRemoval=true) public GraphContainer(IContainer graph, int style, String text, Image image) Deprecated, for removal: This API element is subject to removal in a future version.Since Zest 2.0, useGraphContainer(Graph, int),GraphNode.setText(String), andGraphNode.setImage(Image)
-
-
Method Details
-
setCustomFigure
Custom figures cannot be set on a GraphContainer. -
getNodeFigure
Description copied from class:GraphNodeReturns the figure of the whole node.- Overrides:
getNodeFigurein classGraphNode- Returns:
- nodeFigure
-
close
public void close(boolean animate) Close this node.- Parameters:
animate-
-
open
public void open(boolean animate) Open the container. This opens the graph container to show the nodes within and update the twistie -
getGraph
Gets the graph that this container has been added to.- Specified by:
getGraphin interfaceIContainer
-
getItem
- Specified by:
getItemin interfaceIContainer2
-
getItemType
public int getItemType()Description copied from class:GraphItemGets the graph item type. The item type is one of: GRAPH, NODE or CONNECTION- Specified by:
getItemTypein interfaceIContainer- Overrides:
getItemTypein classGraphNode
-
setLayoutAlgorithm
Description copied from interface:IContainerSets the LayoutAlgorithm for this container and optionally applies it.- Specified by:
setLayoutAlgorithmin interfaceIContainer- Parameters:
algorithm- The layout algorithm to setapplyLayout-
-
getLayoutAlgorithm
- Since:
- 1.10
-
getLayoutContext
- Specified by:
getLayoutContextin interfaceIContainer2- @noreference
- This method is not intended to be referenced by clients.
-
getLayoutBounds
- Specified by:
getLayoutBoundsin interfaceIContainer2- Since:
- 1.12
-
applyLayout
public void applyLayout()Description copied from interface:IContainerRe-applies the current layout algorithm- Specified by:
applyLayoutin interfaceIContainer
-
getScale
public double getScale()Get the scale for this container. This is the scale applied to the children contained within -
setScale
public void setScale(double scale) Set the scale for this container. This is the scale applied to the children contained within.- Parameters:
scale-
-
getHideContainerBounds
- Overrides:
getHideContainerBoundsin classGraphNode
-
initFigure
protected void initFigure()NON API MEMBERS- Overrides:
initFigurein classGraphNode
-
updateFigureForModel
- Overrides:
updateFigureForModelin classGraphNode
-
refreshLocation
protected void refreshLocation()- Overrides:
refreshLocationin classGraphNode
-
addSubgraphFigure
- Specified by:
addSubgraphFigurein interfaceIContainer2- Parameters:
figure-- @noreference
- This method is not intended to be referenced by clients.
-
addNode
- Specified by:
addNodein interfaceIContainer2- Parameters:
node-- @noreference
- This method is not intended to be referenced by clients.
-
getNodes
- Specified by:
getNodesin interfaceIContainer
-
getConnections
Description copied from interface:IContainer2Returns list of connections laying inside this container. Only connections which both source and target nodes lay directly in this container are returned.- Specified by:
getConnectionsin interfaceIContainer2- Since:
- 1.12
-
GraphContainer(Graph, int),GraphNode.setText(String)