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, size
Fields 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 TypeMethodDescriptionvoid
void
addSubgraphFigure
(IFigure figure) void
Re-applies the current layout algorithmvoid
close
(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 Rectangle
getItem()
int
Gets the graph item type.final LayoutContext
Returns the figure of the whole node.getNodes()
double
getScale()
Get the scale for this container.protected void
NON API MEMBERSvoid
open
(boolean animate) Open the container.protected void
void
setCustomFigure
(IFigure nodeFigure) Custom figures cannot be set on a GraphContainer.void
setLayoutAlgorithm
(LayoutAlgorithm algorithm, boolean applyLayout) Sets the LayoutAlgorithm for this container and optionally applies it.void
setScale
(double scale) Set the scale for this container.protected void
updateFigureForModel
(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, unhighlight
Methods inherited from class org.eclipse.zest.core.widgets.GraphItem
checkStyle
Methods inherited from class org.eclipse.swt.widgets.Item
checkSubclass, getImage, getText
Methods 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:GraphNode
Returns the figure of the whole node.- Overrides:
getNodeFigure
in 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:
getGraph
in interfaceIContainer
-
getItem
- Specified by:
getItem
in interfaceIContainer2
-
getItemType
public int getItemType()Description copied from class:GraphItem
Gets the graph item type. The item type is one of: GRAPH, NODE or CONNECTION- Specified by:
getItemType
in interfaceIContainer
- Overrides:
getItemType
in classGraphNode
-
setLayoutAlgorithm
Description copied from interface:IContainer
Sets the LayoutAlgorithm for this container and optionally applies it.- Specified by:
setLayoutAlgorithm
in interfaceIContainer
- Parameters:
algorithm
- The layout algorithm to setapplyLayout
-
-
getLayoutAlgorithm
- Since:
- 1.10
-
getLayoutContext
- Specified by:
getLayoutContext
in interfaceIContainer2
- @noreference
- This method is not intended to be referenced by clients.
-
getLayoutBounds
- Specified by:
getLayoutBounds
in interfaceIContainer2
- Since:
- 1.12
-
applyLayout
public void applyLayout()Description copied from interface:IContainer
Re-applies the current layout algorithm- Specified by:
applyLayout
in 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:
getHideContainerBounds
in classGraphNode
-
initFigure
protected void initFigure()NON API MEMBERS- Overrides:
initFigure
in classGraphNode
-
updateFigureForModel
- Overrides:
updateFigureForModel
in classGraphNode
-
refreshLocation
protected void refreshLocation()- Overrides:
refreshLocation
in classGraphNode
-
addSubgraphFigure
- Specified by:
addSubgraphFigure
in interfaceIContainer2
- Parameters:
figure
-- @noreference
- This method is not intended to be referenced by clients.
-
addNode
- Specified by:
addNode
in interfaceIContainer2
- Parameters:
node
-- @noreference
- This method is not intended to be referenced by clients.
-
getNodes
- Specified by:
getNodes
in interfaceIContainer
-
getConnections
Description copied from interface:IContainer2
Returns list of connections laying inside this container. Only connections which both source and target nodes lay directly in this container are returned.- Specified by:
getConnections
in interfaceIContainer2
- Since:
- 1.12
-
GraphContainer(Graph, int)
,GraphNode.setText(String)