The default implementation of the IFoldingEdgeConverter that is used by the FoldingManager initially and can be customized to suit the application's needs.
Implements
- I
Remarks
This implementation relies on FolderNodeDefaults for configuration options and methods related to initialization and updates. By default, it copies the properties from the original group node to the state, excluding labels.
Examples
const defaultFoldingEdgeConverter = new FoldingEdgeConverter()
// initialize the new edges with a gray style
defaultFoldingEdgeConverter.foldingEdgeDefaults.style =
new PolylineEdgeStyle({ stroke: 'gray' })
defaultFoldingEdgeConverter.foldingEdgeDefaults.copyLabels = true
// initialize the labels with a new style
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.style =
new LabelStyle()
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.shareStyleInstance = true
// initialize all label properties (the default)
// but synchronize only the text after initialization
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.updateFoldingOptions =
FoldingSynchronizationOptions.LABEL_TEXT
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.updateMasterOptions =
FoldingSynchronizationOptions.LABEL_TEXT
defaultFoldingEdgeConverter.foldingEdgeDefaults.labels.autoAdjustPreferredSize = true
manager.foldingEdgeConverter = defaultFoldingEdgeConverterSee Also
Developer's Guide
API
- foldingEdgeDefaults, reuseMasterPorts, reuseFolderNodePorts, MergingFoldingEdgeConverter, ExcludingFoldingEdgeConverter
Members
No filters for this type
Constructors
Properties
Gets or sets the defaults to apply to folding edges.
Gets or sets the defaults to apply to folding edges.
Most of the work of initializeFoldingEdgeState and updateFoldingEdgeState is delegated to this instance when edges are initialized or updated.
final
Gets or sets a property that determines whether this implementation should reuse the ports of folder nodes for the folding edges.
Gets or sets a property that determines whether this implementation should reuse the ports of folder nodes for the folding edges.
The view can be configured to use separate port instances for folding edges. This makes it possible to assign different styles and locations to source and target ports of folding edges, which may be desirable if the style and geometry of folding edges differs a lot from the style of the master edges. Folder nodes (collapsed group nodes), will have all of their master's ports represented in the view. This property can be used to make folding edges that connect to the master ports connect to these folding port instances instead of creating extra folding ports for the edges. Note that ports can only be automatically reused by folding edges if they still connect to the same nodes. Otherwise, the view will have to create new folding ports to let the edges connect to the representing adjacent nodes. This property can be set to
true, if the graph model used is port-centric, i.e. each edge connects to specific ports and even folding edges should still connect to those specific port instances, if possible. The default value is false.final
See Also
Developer's Guide
API
- reuseMasterPorts
Gets or sets a property that determines whether this implementation should reuse the ports of the masterGraph at non-folder nodes for the folding edges.
Gets or sets a property that determines whether this implementation should reuse the ports of the masterGraph at non-folder nodes for the folding edges.
The view can be configured to use separate port instances for folding edges. This makes it possible to assign different styles and locations to source and target ports of folding edges, which may be desirable if the style and geometry of folding edges differs a lot from the style of the master edges. Folding edges may of course still connect to non-folder nodes at one of their ports. Setting this property to
true will make the folding edge connect to the view port instance. This property can be set to true, if the graph model used is port-centric, i.e. each edge connects to specific ports and even folding edges should still connect to those specific view ports. The default value is false.final
See Also
Developer's Guide
API
- reuseFolderNodePorts
Methods
Actually adds the folding edge as a separate edge to the view, reusing existing view ports of the original source and target port, if reuseMasterPorts is enabled and that is possible for the given edge.
Actually adds the folding edge as a separate edge to the view, reusing existing view ports of the original source and target port, if reuseMasterPorts is enabled and that is possible for the given edge.
Parameters
- converterContext: IFoldingEdgeConverterContext
- The IFoldingEdgeConverterContext implementation.
- foldingView: IFoldingView
- The instance into which the folding edge is going to be inserted.
- masterEdge: IEdge
- The edge from the masterGraph that needs to be represented by a folding edge.
- source: INode
- The source node that belongs to the IFoldingView graph that will act as the local view node of the actual source node.
- sourceIsCollapsed: boolean
- Determines whether the
sourceis currently a folder node. - target: INode
- The target node that belongs to the IFoldingView graph that will act as the local view node of the actual target node.
- targetIsCollapsed: boolean
- Determines whether the
targetis currently a folder node.
Implements
IFoldingEdgeConverter.addFoldingEdgeThis method delegates to initializeState of the foldingEdgeDefaults, only.
Parameters
- state: FoldingEdgeState
- The FoldingEdgeState of the edge to change.
- foldingView: IFoldingView
- The graph to which the folding edge belongs.
- foldingEdge: IEdge
- The folding edge for which the appearance might need an update.
- masterEdges: IListEnumerable<IEdge>
- The list of master edges, that the folding edge currently represents.
This method delegates to updateState of the foldingEdgeDefaults, only.
Parameters
- state: FoldingEdgeState
- The FoldingEdgeState of the edge to change.
- foldingView: IFoldingView
- The graph to which the folding edge belongs.
- foldingEdge: IEdge
- The folding edge for which the appearance might need an update.
- masterEdges: IListEnumerable<IEdge>
- The list of master edges, that the folding edge currently represents.
This method delegates to updateMasterEdges of the foldingEdgeDefaults, only.
Parameters
- state: FoldingEdgeState
- The state to synchronize with the master edges.
- foldingView: IFoldingView
- The graph to which the folding edge belongs.
- masterEdges: IListEnumerable<IEdge>
- The edges in the masterGraph to update.