An implementation of IFolderNodeConverter interface which manages the synchronization of the appearance of open and closed group nodes.
Implements
- I
Remarks
This implementation is used by default in the FoldingManager's folderNodeConverter property.
The folderNodeDefaults determine whether and how the folder and group nodes are initialized or synchronized.
Examples
const defaultFolderNodeConverter = new FolderNodeConverter()
// set a gray rectangle to initialize a freshly collapsed group node with
defaultFolderNodeConverter.folderNodeDefaults.style = new ShapeNodeStyle({
stroke: 'gray',
})
// use the same instance for all folders
defaultFolderNodeConverter.folderNodeDefaults.shareStyleInstance = true
// configure label handling: copy the labels
defaultFolderNodeConverter.folderNodeDefaults.copyLabels = true
// initialize labels on a freshly collapsed group node with a default style
defaultFolderNodeConverter.folderNodeDefaults.labels.style =
new LabelStyle()
// share the same style instance
defaultFolderNodeConverter.folderNodeDefaults.labels.shareStyleInstance = true
// copy all properties from the group node labels to the folder node labels
defaultFolderNodeConverter.folderNodeDefaults.labels.initializeOptions =
FoldingSynchronizationOptions.ALL
// copy all properties from the group node labels to the folder node labels
defaultFolderNodeConverter.folderNodeDefaults.labels.updateFoldingOptions =
FoldingSynchronizationOptions.LABEL_TEXT
// upon subsequent collapse and expand: only synchronize the text
defaultFolderNodeConverter.folderNodeDefaults.labels.updateMasterOptions =
FoldingSynchronizationOptions.LABEL_TEXT
// adjust the preferred size to the new text
defaultFolderNodeConverter.folderNodeDefaults.labels.autoAdjustPreferredSize = true
manager.folderNodeConverter = defaultFolderNodeConverterSee Also
Developer's Guide
API
- FoldingManager, IFolderNodeConverter, FoldingEdgeConverter, FolderNodeDefaults
Members
No filters for this type
Constructors
Properties
Gets or sets the instance to delegate most of the work this class performs to.
Gets or sets the instance to delegate most of the work this class performs to.
Most of the functionality of this class can be customized by configuring or subclassing a FolderNodeDefaults instance and assigning it to this property.
final
Methods
This method delegates to folderNodeDefaults' initializeState method.
Parameters
- state: FolderNodeState
- The folder node state to initialize.
- foldingView: IFoldingView
- The graph instance for which the folder node has been created.
- viewNode: INode
- The folder node instance in the view.
- masterNode: INode
- The node that represents the getMasterItem of the view state to change.
Updates the folder node state when the masterNode was modified.
Updates the folder node state when the
masterNode was modified.This method delegates to folderNodeDefaults' updateState method.
Parameters
- state: FolderNodeState
- The folder node state to update.
- foldingView: IFoldingView
- The folding view for which the folder node can be changed.
- viewNode: INode
- The folder node instance in the view.
- masterNode: INode
- The node that represents the getMasterItem of the view state to change.
This method delegates to folderNodeDefaults' updateMasterNode method.
Parameters
- state: FolderNodeState
- The folder node state to get the properties from.
- foldingView: IFoldingView
- The folding view for which the folder node has been changed. The masterGraph can be retrieved from this instance.
- viewNode: INode
- The folder node instance in the view.
- masterNode: INode
- The node that represents the getMasterItem of the view state. This is the item to change.