A helper class that provides configuration options and helper methods that can be used in the context of initializing and updating folding ports.
Remarks
Examples
const defaultFolderNodeConverter = new FolderNodeConverter()
defaultFolderNodeConverter.folderNodeDefaults.ports.copyLabels = true
// initialize: copy all label properties (the default)
// but update only the text after initialization
defaultFolderNodeConverter.folderNodeDefaults.ports.labels.updateFoldingOptions =
FoldingSynchronizationOptions.LABEL_TEXT
defaultFolderNodeConverter.folderNodeDefaults.ports.updateMasterOptions =
FoldingSynchronizationOptions.LABEL_TEXT
defaultFolderNodeConverter.folderNodeDefaults.ports.copyLabels = true
// copy all port properties upon initialization (the default)
// but update only the layout afterward
defaultFolderNodeConverter.folderNodeDefaults.ports.updateFoldingOptions =
FoldingSynchronizationOptions.LAYOUT
defaultFolderNodeConverter.folderNodeDefaults.ports.updateMasterOptions =
FoldingSynchronizationOptions.LAYOUT
manager.folderNodeConverter = defaultFolderNodeConverter
Type Details
- yFiles module
- view
See Also
Constructors
Creates a new instance of this type, optionally configuring the values from the given IPortDefaults object.
Parameters
A map of options to pass to the method.
- defaults - IPortDefaults
- The optional IPortDefaults to initialize the properties of this new instance from.
- initializeOptions - FoldingSynchronizationOptions
- What properties to initialize the FoldingPortState with when a port is initialized from its master port. This option sets the initializeOptions property on the created object.
- updateFoldingOptions - FoldingSynchronizationOptions
- What properties to update the FoldingPortState with when a folding port is updated to reflect changes made to its master item. This option sets the updateFoldingOptions property on the created object.
- updateMasterOptions - FoldingSynchronizationOptions
- What properties to backpropagate from the FoldingPortState when a master port is updated to reflect changes made to its folding variant. This option sets the updateMasterOptions property on the created object.
- copyLabels - boolean
- Whether to copy the labels from the master item to the view item. This option sets the copyLabels property on the created object.
- labels - FoldingLabelDefaults
- The FoldingLabelDefaults to which updating the ports' labels will be delegated. This option either sets the value directly or recursively sets properties to the instance of the labels property on the created object.
- style - IPortStyle
- The IPortStyle to use for initializing the folding ports. This option sets the style property on the created object.
- shareStyleInstance - boolean
- A value indicating whether the port style instance should be shared referentially or cloned. This option sets the shareStyleInstance property on the created object.
- locationParameter - IPortLocationModelParameter
- The IPortLocationModelParameter to use for initializing the folding ports. This option sets the locationParameter property on the created object.
Properties
Gets or sets whether to copy the labels from the master item to the view item.
Remarks
This setting determines how to delegate the work of synchronizing labels to the labels instance. Set the value to false
if you need to implement your own logic. Otherwise, this feature can be used to initially create a copy of the labels of the master (if any) and subsequently synchronize the labels with changes to the master.
The default is false
for new instances of this type.
See Also
Gets or sets what properties to initialize the FoldingPortState with when a port is initialized from its master port.
Remarks
Gets or sets the FoldingLabelDefaults to which updating the ports' labels will be delegated.
Remarks
See Also
Gets or sets the IPortLocationModelParameter to use for initializing the folding ports.
Remarks
null
(the default) will leave the model parameter property unmodified.Gets or sets the IPortStyle to use for initializing the folding ports.
Remarks
Depending on the shareStyleInstance property, initializeState will either assign a clone to the property or this instance.
A value of null
(the default) will leave the style property unmodified.
See Also
Gets or sets what properties to update the FoldingPortState with when a folding port is updated to reflect changes made to its master item.
Remarks
See Also
Gets or sets what properties to backpropagate from the FoldingPortState when a master port is updated to reflect changes made to its folding variant.
Remarks
See Also
Methods
Creates the default IPortStyle to use in initializeState.
Returns
- ↪IPortStyle?
- The style or a clone of it depending on the shareStyleInstance property. This method may return
null
to indicate that the style should be obtained from the master port.
This implementation initializes the immediate properties of the FoldingPortState.
Remarks
Parameters
A map of options to pass to the method.
- state - FoldingPortState
- The state object to write the values to
- masterPort - IPort
- A single master port that is associated with this folding port and used to initialize it.
See Also
Callback that initializes the labels during initializeState.
Remarks
Parameters
A map of options to pass to the method.
- state - FoldingPortState
- The state object to write the values to
- masterPort - IPort
- The single master port associated with this folding port.
Called by implementations of the IFolderNodeConverter and IFoldingEdgeConverter interfaces to initialize the state of a port in the folding view.
Remarks
Parameters
A map of options to pass to the method.
- state - FoldingPortState
- The state object to use for modifying the properties.
- masterPorts - IEnumerable<IPort>
- The collection of ports this folding port represents.
See Also
Callback that updates the labels during updateState.
Remarks
Parameters
A map of options to pass to the method.
- state - FoldingPortState
- The state object to write the values to
- masterPort - IPort
- The single master port associated with this folding port.
Updates the labels of the master ports to match the state of the folding variants.
Remarks
Parameters
A map of options to pass to the method.
- masterGraph - IGraph
- The graph to use for modifying the master labels.
- state - FoldingPortState
- The state of the folding port and its labels to synchronize with.
- masterPort - IPort
- The master port to synchronize.
See Also
Updates a single master port to match the state of the folding port.
Remarks
Parameters
A map of options to pass to the method.
- masterGraph - IGraph
- The graph to use for modifying the master port.
- state - FoldingPortState
- The state of the port to synchronize with.
- masterPort - IPort
- The master port to synchronize.
Called by implementations of the IFolderNodeConverter and IFoldingEdgeConverter interfaces to update the state of a port in the folding view, once it has changed.
Remarks
Parameters
A map of options to pass to the method.
- state - FoldingPortState
- The state object to use for modifying the properties.
- masterPorts - IEnumerable<IPort>
- The collection of ports this folding port represents.