I

IFoldingEdgeConverter

Interface used by FoldingManager and IFoldingView which is responsible for managing edges between folder nodes.
Inheritance Hierarchy

Remarks

Since createFoldingView creates views that can potentially contain edges that connect to nodes which have a different set of attributes, these edges might need to have a separate set of attributes, too. Implementations of this interface are being called by the IFoldingViews to configure these kind of folding edges.

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
const mergingFoldingEdgeConverter = new MergingFoldingEdgeConverter()
mergingFoldingEdgeConverter.ignoreEdgeDirection = true
mergingFoldingEdgeConverter.foldingEdgeDefaults.copyLabels = true
mergingFoldingEdgeConverter.foldingEdgeDefaults.style =
  new PolylineEdgeStyle({ stroke: 'gray' })
manager.foldingEdgeConverter = mergingFoldingEdgeConverter

See Also

Developer's Guide

API

FoldingEdgeConverter, foldingEdgeConverter, FoldingEdgeStateId

Members

No filters for this type

Methods

This method gets called by the IFoldingView implementation to determine whether a given edge in the masterGraph should be represented by a folding edge in the given view.
The implementation will be passed in a converterContext object that implements the IFoldingEdgeConverterContext interface, which needs to be used by the implementation to communicate the result of the query. The implementation needs to either call addAsSeparateEdge or addToExistingFoldingEdge. The implementation can optionally query the existing folding edges between the source and target node and decide whether to add the edge to the existing folding edge.
abstract

Parameters

converterContext: IFoldingEdgeConverterContext
The IFoldingEdgeConverterContext implementation that needs to be called in order to communicate the results of this query.
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. Note that you may not return this instance.
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.
Triggered by the view to initially create the appearance of a folding edge.
Implementations may not use the IFoldingView's graph instance to modify the foldingEdge, because this would create and enqueue undo events. Rather, the properties provided by the state implementation must be set.
abstract

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 shall be determined.
masterEdges: IListEnumerable<IEdge>
The list of master edges, that the folding edge initially represents.

See Also

API
updateFoldingEdgeState
Triggered by the view to adjust the appearance of a folding edge.

For instance, it can be used to reflect a state change in the master edges that make up that folding edge.

Implementations may not use the IFoldingView's graph instance to modify the foldingEdge, because this would create and enqueue undo events. Rather, the properties provided by the state implementation must be set.

abstract

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.

See Also

Developer's Guide
API
initializeFoldingEdgeState
Callback to optionally back propagate state changes on a folding edge's state to the masterEdges.
abstract

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.

See Also

API
updateMasterEdges

Static Methods

static

Parameters

Return Value

IFoldingEdgeConverter