This class is a default implementation of interface IElementFactory.
Type Details
- yfiles module
- layout-multipage
- yfiles-umd modules
- layout-multipage, layout
- Legacy UMD name
- yfiles.multipage.DefaultElementFactory
See Also
Constructors
Creates a new instance of DefaultElementFactory.
Methods
createConnectorEdge
(context: LayoutContext, connector: YNode, opposite: YNode, origEdgeId: Object, atTarget: boolean) : EdgeCallback method for creating an edge of type CONNECTOR.
Remarks
Such an edge connects the given connector and opposite node.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - LayoutContext
- an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
- connector - YNode
- the endpoint of the edge that represents the connector node
- opposite - YNode
- the other endpoint of the edge
- origEdgeId - Object
- the ID of the edge that is split by the connector edge
- atTarget - boolean
true
if the connector node is the target of the edge,false
otherwise
Returns
- ↪Edge
- the created connector edge
See Also
Implements
Callback method for creating a node of type CONNECTOR.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - LayoutContext
- an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
- edgeIds - YList
- a list that contains the IDs of edges that are split by this connector
- representedNodeId - Object
- the ID of the node that is represented by this connector
Returns
- ↪YNode
- the created connector node
See Also
Implements
createProxyEdge
(context: LayoutContext, proxyNode: YNode, opposite: YNode, replacingEdgeId: Object, origNodeId: Object) : EdgeCallback method for creating an edge of type PROXY.
Remarks
Such an edge should connect the given proxy and opposite node.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - LayoutContext
- an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
- proxyNode - YNode
- the endpoint of the edge that represents the proxy node
- opposite - YNode
- the other endpoint of the new edge
- replacingEdgeId - Object
- the ID of the related edge that is connected to the original node
- origNodeId - Object
- the ID of the original node to which the proxy node refers
Returns
- ↪Edge
- the created proxy edge
See Also
Implements
Callback method for creating a node of type PROXY.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - LayoutContext
- an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
- origNodeId - Object
- the ID of the node for which a proxy has to be created
Returns
- ↪YNode
- the created proxy node
See Also
Implements
createProxyReferenceEdge
(context: LayoutContext, proxyReference: YNode, opposite: YNode, referencingCopyId: Object) : EdgeCallback method for creating an edge of type PROXY_REFERENCE.
Remarks
Such an (undirected) edge should connect the given proxy reference and opposite node.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - LayoutContext
- an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
- proxyReference - YNode
- the endpoint of the edge that represents the proxy reference node
- opposite - YNode
- the other endpoint of the new edge
- referencingCopyId - Object
- the ID of the proxy node that is referenced by the proxy reference node
Returns
- ↪Edge
- the created proxy reference edge
See Also
Implements
Callback method for creating a node of type PROXY_REFERENCE.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - LayoutContext
- an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
- referringProxyId - Object
- the ID of the proxy to which the created node refers
Returns
- ↪YNode
- the new proxy reference node
See Also
Implements
Returns the default size for nodes created by this factory.
Remarks
This method is called from createConnectorNode, createProxyReferenceNode, and/or createProxyNode. It must return a non-null
size with positive width and height.
Subclasses may implement this method to use custom size values.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- context - LayoutContext
- an object providing relevant layout information, for example, the current graph as well as various information about the graph elements
- id - Object
- the element ID
- type - number
- the type of the node to be created
Returns
- ↪YDimension
- the default size of the new node