|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.DefaultGraph2DFactory y.view.hierarchy.DefaultHierarchyGraphFactory
public class DefaultHierarchyGraphFactory
This is the default graph factory used by HierarchyManager
to create
and configure new graph elements within the hierarchy.
The graph factory creates graphs of type Graph2D
and corresponding graph
elements, i.e., in particular, group nodes and folder nodes.
It is also responsible for configuring the default node realizers used for the
representation of both group nodes and folder nodes.
Whenever a new graph is created by this factory, it will inherit all listeners registered with the parent graph, i.e., all GraphListener, Graph2DListener, and Graph2DSelectionListener references are copied. The new graph will also use the same default node realizers as the parent graph.
Constructor Summary | |
---|---|
DefaultHierarchyGraphFactory()
Creates a new instance of DefaultHierarchyGraphFactory. |
Method Summary | |
---|---|
protected void |
configureGraph(Graph2D createdGraph,
java.lang.Object hint)
Adds all GraphListener , Graph2DListener , and Graph2DSelectionListener
references that are registered with the parent graph to the newly created graph. |
Graph |
createGraph(java.lang.Object hint)
Creates a new Graph2D that is configured
as a copy of the given parent graph, basically. |
Node |
createNode(Graph graph,
java.lang.Object hint)
Creates a new node in the given graph. |
NodeRealizer |
createNodeRealizer(java.lang.Object hint)
Creates a realizer for a node. |
NodeRealizer |
getDefaultFolderNodeRealizer()
Returns the default node realizer for folder nodes. |
NodeRealizer |
getDefaultGroupNodeRealizer()
Returns the default node realizer for group nodes. |
boolean |
isProxyNodeRealizerEnabled()
Returns whether or not to use a proxy node realizer that delegates to the default realizers for group or folder nodes. |
void |
setDefaultFolderNodeRealizer(NodeRealizer r)
Sets the default node realizer for folder nodes. |
void |
setDefaultGroupNodeRealizer(NodeRealizer r)
Sets the default node realizer for group nodes. |
void |
setProxyNodeRealizerEnabled(boolean proxyNodeRealizerEnabled)
Whether or not this class should assign a proxy node realizer to all group and folder nodes. |
Methods inherited from class y.view.DefaultGraph2DFactory |
---|
createEdge |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultHierarchyGraphFactory()
getDefaultGroupNodeRealizer()
,
getDefaultFolderNodeRealizer()
Method Detail |
---|
public Graph createGraph(java.lang.Object hint)
configured
as a copy of the given parent graph, basically.
createGraph
in interface GraphFactory
createGraph
in class DefaultGraph2DFactory
hint
- Is expected to be the parent graph of the newly created graph.
configured
Graph2D.protected void configureGraph(Graph2D createdGraph, java.lang.Object hint)
GraphListener
, Graph2DListener
, and Graph2DSelectionListener
references that are registered with the parent graph to the newly created graph.
Note that the newly created graph will also use the same default node realizers as the parent graph.
createdGraph
- A newly created Graph2D instance.hint
- Is expected to be the parent graph of the newly created graph.public Node createNode(Graph graph, java.lang.Object hint)
Graph
the newly created node is considered to be a
folder node within the hierarchy. Otherwise it is considered to be a
group node. Calls createNodeRealizer(Object)
to create a
NodeRealizer
for the new node.
createNode
in interface GraphFactory
createNode
in class DefaultGraph2DFactory
graph
- the graph containing the newly created node.hint
- the hint object will be ignored.
createNodeRealizer(Object)
public NodeRealizer createNodeRealizer(java.lang.Object hint)
ProxyShapeNodeRealizer
.
Else, this method creates realizers from its folder and group node realizer
templates as returned by getDefaultFolderNodeRealizer()
and
getDefaultGroupNodeRealizer()
, respectively. The folder
template is chosen if hint
is of type Graph
,
otherwise the group template is used.
createNode(Graph, Object)
,
isProxyNodeRealizerEnabled()
,
setProxyNodeRealizerEnabled(boolean)
,
getDefaultFolderNodeRealizer()
,
getDefaultGroupNodeRealizer()
public void setDefaultGroupNodeRealizer(NodeRealizer r)
getDefaultGroupNodeRealizer()
public void setDefaultFolderNodeRealizer(NodeRealizer r)
getDefaultFolderNodeRealizer()
public NodeRealizer getDefaultGroupNodeRealizer()
setDefaultGroupNodeRealizer(NodeRealizer)
public NodeRealizer getDefaultFolderNodeRealizer()
setDefaultFolderNodeRealizer(NodeRealizer)
public void setProxyNodeRealizerEnabled(boolean proxyNodeRealizerEnabled)
0
of the
realizer list. The realizer for folder nodes can be found at position 1
of this list.
The main purpose of using a proxy node realizer is to be able to use completely different realizers to represent open and closed group nodes.
By default, this feature is deactivated.
ProxyShapeNodeRealizer
,
ProxyShapeNodeRealizer.getRealizer(int)
,
ProxyShapeNodeRealizer.setRealizerDelegate(NodeRealizer)
public boolean isProxyNodeRealizerEnabled()
setProxyNodeRealizerEnabled(boolean)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |