The default implementation of the IFoldingEdgeConverter that is used by the FoldingManager initially and can be customized to suit the application's needs.
Remarks
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 = defaultFoldingEdgeConverter
Type Details
- yFiles module
- view
See Also
Sample Graphs
Constructors
Parameters
A map of options to pass to the method.
- foldingEdgeDefaults - FoldingEdgeDefaults
- The defaults to apply to folding edges. This option either sets the value directly or recursively sets properties to the instance of the foldingEdgeDefaults property on the created object.
- reuseMasterPorts - boolean
- A property that determines whether this implementation should reuse the ports of the masterGraph at non-folder nodes for the folding edges. This option sets the reuseMasterPorts property on the created object.
- reuseFolderNodePorts - boolean
- A property that determines whether this implementation should reuse the ports of folder nodes for the folding edges. This option sets the reuseFolderNodePorts property on the created object.
Properties
Gets or sets the defaults to apply to folding edges.
Remarks
Gets or sets a property that determines whether this implementation should reuse the ports of folder nodes for the folding edges.
Remarks
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
.See Also
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.
Remarks
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
.See Also
Methods
addFoldingEdge
(converterContext: IFoldingEdgeConverterContext, foldingView: IFoldingView, masterEdge: IEdge, source: INode, sourceIsCollapsed: boolean, target: INode, targetIsCollapsed: boolean)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
A map of options to pass to the method.
- 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
source
is 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
target
is currently a folder node.
Implements
initializeFoldingEdgeState
(state: FoldingEdgeState, foldingView: IFoldingView, foldingEdge: IEdge, masterEdges: IListEnumerable<IEdge>)Initializes the folding edge appearance.
Remarks
Parameters
A map of options to pass to the method.
- 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.
See Also
Implements
updateFoldingEdgeState
(state: FoldingEdgeState, foldingView: IFoldingView, foldingEdge: IEdge, masterEdges: IListEnumerable<IEdge>)Updates the state
when the masterEdges
were modified.
Remarks
Parameters
A map of options to pass to the method.
- 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.
See Also
Implements
updateMasterEdges
(state: FoldingEdgeState, foldingView: IFoldingView, masterEdges: IListEnumerable<IEdge>)Updates the masterEdges
when the state
was modified.
Remarks
Parameters
A map of options to pass to the method.
- 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.