An implementation of IFolderNodeConverter interface which manages the appearance of folder nodes according to a number of properties and overridable methods.
Remarks
This implementation is used by default in the FoldingManager's folderNodeConverter property.
This class has a couple of properties that can be adjusted to customize the behavior. Also, it contains a number of callback methods for conveniently overriding the implementation in custom sub classes.
Examples
manager.folderNodeConverter = new DefaultFolderNodeConverter({
copyFirstLabel: true,
folderNodeStyle: new ShapeNodeStyle({ fill: Fill.GRAY })
})
Type Details
- yfiles module
- view-folding
- yfiles-umd modules
- view-folding, view-graphml, view
- Legacy UMD name
- yfiles.graph.DefaultFolderNodeConverter
See Also
Constructors
Initializes a new instance of this class with default values.
Parameters
A map of options to pass to the method.
- folderNodeStyle - INodeStyle
The INodeStyle to use for the collapsed group nodes. This option sets the folderNodeStyle property on the created object.
- copyFirstLabel - boolean
A value indicating whether the first label of the master group node should be recreated for the collapsed group node instance. This option sets the copyFirstLabel property on the created object.
- labelStyle - ILabelStyle
The ILabelStyle to use for the first label of the collapsed group nodes. This option sets the labelStyle property on the created object.
- portLabelStyle - ILabelStyle
The ILabelStyle to use for the first label of the ports of the collapsed group nodes. This option sets the portLabelStyle property on the created object.
- labelLayoutParameter - ILabelModelParameter
The ILabelModelParameter to use for the first label of the collapsed group node. This option sets the labelLayoutParameter property on the created object.
- portLabelLayoutParameter - ILabelModelParameter
The ILabelModelParameter to use for the first label of ports at the collapsed group node. This option sets the portLabelLayoutParameter property on the created object.
- portStyle - IPortStyle
The IPortStyle to use for the ports at the collapsed group node that represent the ports of the master group node in the collapsed state. This option sets the portStyle property on the created object.
- folderNodeSize - Size
The initial size of the layout of the collapsed group node that will be assigned during the creation of the appearance of the collapsed group node. This option sets the folderNodeSize property on the created object.
- portLocationParameter - IPortLocationModelParameter
The IPortLocationModelParameter to use for the ports at the collapsed group node that represent the ports of the master group node in the collapsed state. This option sets the portLocationParameter property on the created object.
- cloneNodeStyle - boolean
A value indicating whether the folderNodeStyle instance should be assigned as a clone or not. This option sets the cloneNodeStyle property on the created object.
- clonePortStyle - boolean
A value indicating whether the portStyle instance should be assigned as a clone or not. This option sets the clonePortStyle property on the created object.
- clonePortLocationParameter - boolean
A value indicating whether the portLocationParameter instance should be assigned as a clone or not. This option sets the clonePortLocationParameter property on the created object.
- cloneLabelStyle - boolean
A value indicating whether the labelStyle instance should be assigned as a clone or not. This option sets the cloneLabelStyle property on the created object.
- cloneLabelLayoutParameter - boolean
A value indicating whether the labelLayoutParameter instance should be assigned as a clone or not. This option sets the cloneLabelLayoutParameter property on the created object.
Initializes a new instance of this class using the values provided by the folderNodeDefaults
parameter.
Properties
Gets or sets a value indicating whether the labelLayoutParameter instance should be assigned as a clone or not.
Gets or sets a value indicating whether the labelStyle instance should be assigned as a clone or not.
Gets or sets a value indicating whether the folderNodeStyle instance should be assigned as a clone or not.
Gets or sets a value indicating whether the portLocationParameter instance should be assigned as a clone or not.
Gets or sets a value indicating whether the first label of the master group node should be recreated for the collapsed group node instance.
Remarks
true
if the first label should be copied; false
otherwise. The default is false
.See Also
Sets the initial size of the layout of the collapsed group node that will be assigned during the creation of the appearance of the collapsed group node.
Remarks
null
values will make the initial layout of the collapsed node become the given size assigned. The default is null
See Also
Gets or sets the INodeStyle to use for the collapsed group nodes.
Remarks
Depending on the cloneNodeStyle property this implementation will assign a clone to the property or this instance. The default is null
A value of null
will leave the style property unmodified.
Gets or sets the ILabelModelParameter to use for the first label of the collapsed group node.
Remarks
This will only affect the folder node if the copyFirstLabel property is set to true
. The default is null
A value of null
will leave the label model parameter property unmodified.
See Also
Gets or sets the ILabelStyle to use for the first label of the collapsed group nodes.
Remarks
This will only affect the collapsed group node if the copyFirstLabel property is set to true
. The default is null
A value of null
will leave the style property unmodified.
See Also
Gets or sets the ILabelModelParameter to use for the first label of ports at the collapsed group node.
Remarks
This will only affect the folder node if the copyFirstLabel property is set to true
. The default is null
A value of null
will leave the label model parameter property unmodified.
See Also
Gets or sets the ILabelStyle to use for the first label of the ports of the collapsed group nodes.
Remarks
This will only affect the collapsed group node if the copyFirstLabel property is set to true
. The default is null
A value of null
will leave the style property unmodified.
See Also
Gets or sets the IPortLocationModelParameter to use for the ports at the collapsed group node that represent the ports of the master group node in the collapsed state.
Remarks
null
will leave the location parameter property unmodified. The default is null
See Also
Gets or sets the IPortStyle to use for the ports at the collapsed group node that represent the ports of the master group node in the collapsed state.
Remarks
null
will leave the style property unmodified. The default is null
See Also
Methods
createLabelLayoutParameter
(foldingView: IFoldingView, localLabel: ILabel, masterLabel: ILabel) : ILabelModelParameterCreates the ILabelModelParameter for use in initializeFolderNodeLabels.
Parameters
A map of options to pass to the method.
- foldingView - IFoldingView
- The folding view instance.
- localLabel - ILabel
- The local label in the view whose layoutParameter should be initialized. May be
null
if the label layout parameter is requested for the label creation. - masterLabel - ILabel
- The label that is being represented by the folding label.
Returns
- ↪ILabelModelParameter
- The labelLayoutParameter (or portLabelLayoutParameter for port labels) or a clone of it depending on the cloneLabelLayoutParameter property. This method may return
null
to indicate that the default label layout parameter should not be changed.
Creates the ILabelStyle for use in initializeFolderNodeLabels.
Parameters
A map of options to pass to the method.
- foldingView - IFoldingView
- The folding view instance.
- localLabel - ILabel
- The local label in the view whose style should be initialized. May be
null
if the label style is requested for the label creation. - masterLabel - ILabel
- The label that is being represented by the folding label.
Returns
- ↪ILabelStyle
- The labelStyle (or portLabelStyle for port labels) or a clone of it depending on the cloneLabelStyle property. This method may return
null
to indicate that the default style should not be changed.
Creates the INodeStyle for use in initializeFolderNodeStyle.
Parameters
A map of options to pass to the method.
- foldingView - IFoldingView
- The folding view instance.
- viewNode - INode
- The local folder node in the view whose style should be initialized.
- masterNode - INode
- The node that is being represented by the folder node.
Returns
- ↪INodeStyle
- The folderNodeStyle or a clone of it depending on the cloneNodeStyle property. This method may return
null
to indicate that the default style should not be changed.
createPortLocationParameter
(foldingView: IFoldingView, localPort: IPort, masterPort: IPort) : IPortLocationModelParameterCreates the IPortLocationModelParameter for use in initializeFolderNodePorts.
Parameters
A map of options to pass to the method.
- foldingView - IFoldingView
- The folding view instance.
- localPort - IPort
- The local port in the view whose locationParameter should be initialized.
- masterPort - IPort
- The port that is being represented by the folding port.
Returns
- ↪IPortLocationModelParameter
- The portLocationParameter or a clone of it depending on the clonePortLocationParameter property. This method may return
null
to indicate that the default port location parameter should not be changed.
Creates the IPortStyle for use in initializeFolderNodePorts.
Parameters
A map of options to pass to the method.
- foldingView - IFoldingView
- The folding view instance.
- localPort - IPort
- The local port in the view whose style should be initialized.
- masterPort - IPort
- The port that is being represented by the folding port.
Returns
- ↪IPortStyle
- The portStyle or a clone of it depending on the clonePortStyle property. This method may return
null
to indicate that the default style should not be changed.
Gets the preferred size for use in initializeFolderNodeLabels and synchronizeLabels.
initializeFolderNodeLabels
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Initializes the initial labels of the collapsed group node.
Remarks
null
when adding the label on the folder node.Parameters
A map of options to pass to the method.
- state - FolderNodeState
- The node view state whose labels should be synchronized.
- foldingView - IFoldingView
- The folding view instance that has triggered the initializeFolderNodeState call.
- viewNode - INode
- The collapsed group node in the view that may be changed using the FolderNodeState.
- masterNode - INode
- The master node that the folder node represents.
See Also
initializeFolderNodeLayout
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Initializes the layout of the collapsed group node.
Remarks
null
) but not smaller than the minimum size that is reported by a potential INodeSizeConstraintProvider for INodes that has been found in the ILookup of the viewNode
.Parameters
A map of options to pass to the method.
- state - FolderNodeState
- The node view state whose layout should be synchronized.
- foldingView - IFoldingView
- The folding view instance.
- viewNode - INode
- The local collapsed group node to change.
- masterNode - INode
- The master node that is represented by the local group node.
initializeFolderNodePorts
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Called by initializeFolderNodeState to initialize the appearance of the representatives of the master ports at the collapsed group node.
Remarks
null
.Parameters
A map of options to pass to the method.
- state - FolderNodeState
- The node view state whose ports should be synchronized.
- foldingView - IFoldingView
- The folding view instance.
- viewNode - INode
- The local group node.
- masterNode - INode
- The master group node.
initializeFolderNodeState
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Implements the initializeFolderNodeState method and initializes the appearance of the collapsed group node.
Remarks
Parameters
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 viewstate to change.
See Also
Implements
initializeFolderNodeStyle
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Initializes the style property of the collapsed group node.
Remarks
null
value has been returned.Parameters
A map of options to pass to the method.
- state - FolderNodeState
- The node view state whose style should be synchronized.
- foldingView - IFoldingView
- The folding view instance that has triggered the initializeFolderNodeState call.
- viewNode - INode
- The local node in the view that may be changed using the FolderNodeState.
- masterNode - INode
- The master node that the local folder node represents.
See Also
synchronizeLabels
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Called by updateFolderNodeState to synchronize the first label if copyFirstLabel is enabled.
Remarks
Parameters
A map of options to pass to the method.
- state - FolderNodeState
- The node view state whose labels should be synchronized.
- foldingView - IFoldingView
- The folding view.
- viewNode - INode
- The local node instance.
- masterNode - INode
- The master node.
updateFolderNodeState
(state: FolderNodeState, foldingView: IFoldingView, viewNode: INode, masterNode: INode)Implements the updateFolderNodeState method and changes the folder node appearance.
Remarks
Parameters
A map of options to pass to the method.
- state - FolderNodeState
- The folder node state to update.
- foldingView - IFoldingView
- The graph instance 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 viewstate to change.