An implementation of IFolderNodeConverter interface which manages the synchronization of the appearance of open and closed group nodes.
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 = defaultFolderNodeConverter
Type Details
- yFiles module
- view
See Also
Constructors
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- folderNodeDefaults - FolderNodeDefaults
- The instance to delegate most of the work this class performs to. This option either sets the value directly or recursively sets properties to the instance of the folderNodeDefaults property on the created object.
Properties
Gets or sets the instance to delegate most of the work this class performs to.
Remarks
Most of the functionality of this class can be customized by configuring or subclassing a FolderNodeDefaults instance and assigning it to this property.
Methods
initializeFolderNodeState
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Initializes the appearance of the collapsed group node.
Remarks
This method delegates to folderNodeDefaults' initializeState method.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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.
See Also
Implements
updateFolderNodeState
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Updates the folder node state when the masterNode
was modified.
Remarks
This method delegates to folderNodeDefaults' updateState method.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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.
See Also
Implements
updateGroupNodeState
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Updates the masterNode
when the state
was modified.
Remarks
This method delegates to folderNodeDefaults' updateMasterNode method.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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.