Search this API

y.layout.multipage
Interface ElementFactory

All Known Implementing Classes:
DefaultElementFactory

public interface ElementFactory

Factory used by class MultiPageLayouter to create special nodes and edges.

 
Your browser does not support SVG content.

Method Summary
 Edge createConnectorEdge(LayoutContext context, Node connector, Node opposite, java.lang.Object origEdgeId, boolean atTarget)
          Callback method for creating an edge of type EdgeInfo.TYPE_CONNECTOR.
 Node createConnectorNode(LayoutContext context, YList edgesIds, java.lang.Object representedNodeId)
          Callback method for creating a node of type NodeInfo.TYPE_CONNECTOR.
 Edge createProxyEdge(LayoutContext context, Node proxyNode, Node opposite, java.lang.Object replacingEdgeId, java.lang.Object origNodeId)
          Callback method for creating an edge of type EdgeInfo.TYPE_PROXY.
 Node createProxyNode(LayoutContext context, java.lang.Object origNodeId)
          Callback method for creating a node of type NodeInfo.TYPE_PROXY.
 Edge createProxyReferenceEdge(LayoutContext context, Node proxyReference, Node opposite, java.lang.Object referencingCopyId)
          Callback method for creating an edge of type EdgeInfo.TYPE_PROXY_REFERENCE.
 Node createProxyReferenceNode(LayoutContext context, java.lang.Object referringProxyId)
          Callback method for creating a node of type NodeInfo.TYPE_PROXY_REFERENCE.
 

Method Detail

createConnectorNode

Node createConnectorNode(LayoutContext context,
                         YList edgesIds,
                         java.lang.Object representedNodeId)
Callback method for creating a node of type NodeInfo.TYPE_CONNECTOR.

 
Multi-edges (edges connecting the same node pair) may be split by the same connector pair, see MultiPageLayouter.setEdgeBundleModeMask(int). Hence, the list of edgeIds may contain several entries.
Parameters:
context - an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
edgesIds - a list that contains the IDs of edges that are split by this connector
representedNodeId - the ID of the node that is represented by this connector
Returns:
the created connector node
See Also:
NodeInfo.TYPE_CONNECTOR, LayoutContext.createNode(Object), NodeInfo.getRepresentedNode()

createProxyReferenceNode

Node createProxyReferenceNode(LayoutContext context,
                              java.lang.Object referringProxyId)
Callback method for creating a node of type NodeInfo.TYPE_PROXY_REFERENCE.

 
All implementations have to use method LayoutContext.createNode(Object) to create the node.
Parameters:
context - an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
referringProxyId - the ID of the proxy to which the created node refers
Returns:
the new proxy reference node
See Also:
NodeInfo.TYPE_PROXY_REFERENCE, LayoutContext.createNode(Object), NodeInfo.TYPE_PROXY

createProxyNode

Node createProxyNode(LayoutContext context,
                     java.lang.Object origNodeId)
Callback method for creating a node of type NodeInfo.TYPE_PROXY.

 
All implementations have to use method LayoutContext.createNode(Object) to create the node.
Parameters:
context - an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
origNodeId - the ID of the node for which a proxy has to be created
Returns:
the created proxy node
See Also:
LayoutContext.createNode(Object), NodeInfo.TYPE_PROXY_REFERENCE, NodeInfo.TYPE_PROXY

createConnectorEdge

Edge createConnectorEdge(LayoutContext context,
                         Node connector,
                         Node opposite,
                         java.lang.Object origEdgeId,
                         boolean atTarget)
Callback method for creating an edge of type EdgeInfo.TYPE_CONNECTOR. Such an edge connects the given connector and opposite node.

 
All implementations have to use method LayoutContext.createEdge(y.base.Node, y.base.Node, Object) to create the edge.
Parameters:
context - an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
connector - the endpoint of the edge that represents the connector node
opposite - the other endpoint of the edge
origEdgeId - the ID of the edge that is split by the connector edge
atTarget - true if the connector node is the target of the edge, false otherwise
Returns:
the created connector edge
See Also:
EdgeInfo.TYPE_CONNECTOR, NodeInfo.TYPE_CONNECTOR, LayoutContext.createEdge(y.base.Node, y.base.Node, java.lang.Object)

createProxyReferenceEdge

Edge createProxyReferenceEdge(LayoutContext context,
                              Node proxyReference,
                              Node opposite,
                              java.lang.Object referencingCopyId)
Callback method for creating an edge of type EdgeInfo.TYPE_PROXY_REFERENCE. Such an (undirected) edge should connect the given proxy reference and opposite node.

 
All implementations have to use method LayoutContext.createEdge(y.base.Node, y.base.Node, Object) to create the edge.
Parameters:
context - an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
proxyReference - the endpoint of the edge that represents the proxy reference node
opposite - the other endpoint of the new edge
referencingCopyId - the ID of the proxy node that is referenced by the proxy reference node
Returns:
the created proxy reference edge
See Also:
EdgeInfo.TYPE_PROXY_REFERENCE, NodeInfo.TYPE_PROXY_REFERENCE, LayoutContext.createEdge(y.base.Node, y.base.Node, java.lang.Object)

createProxyEdge

Edge createProxyEdge(LayoutContext context,
                     Node proxyNode,
                     Node opposite,
                     java.lang.Object replacingEdgeId,
                     java.lang.Object origNodeId)
Callback method for creating an edge of type EdgeInfo.TYPE_PROXY. Such an edge should connect the given proxy and opposite node.

 
All implementations have to use method LayoutContext.createEdge(y.base.Node, y.base.Node, Object) to create the edge.
Parameters:
context - an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
proxyNode - the endpoint of the edge that represents the proxy node
opposite - the other endpoint of the new edge
replacingEdgeId - the ID of the related edge that is connected to the original node
origNodeId - the ID of the original node to which the proxy node refers
Returns:
the created proxy edge
See Also:
EdgeInfo.TYPE_PROXY, NodeInfo.TYPE_PROXY, LayoutContext.createEdge(y.base.Node, y.base.Node, java.lang.Object)

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.