A helper class that provides configuration options and helper methods that can be used in the context of initializing and updating folding labels.
Remarks
Type Details
- yFiles module
- view
See Also
Constructors
Creates a new instance of this type, optionally configuring the values from the given ILabelDefaults object.
Parameters
A map of options to pass to the method.
- defaults - ILabelDefaults
- The optional ILabelDefaults to initialize the properties of this new instance from.
- initializeOptions - FoldingSynchronizationOptions
- What properties to initialize the FoldingLabelState with when a folding label is added to the owner for the first time. This option sets the initializeOptions property on the created object.
- updateFoldingOptions - FoldingSynchronizationOptions
- What properties to update the FoldingLabelState with when a folding label 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 FoldingLabelState when a master label is updated to reflect changes made to its folding variant. This option sets the updateMasterOptions property on the created object.
- style - ILabelStyle
- The ILabelStyle to use when initializing the folding labels. This option sets the style property on the created object.
- autoAdjustPreferredSize - boolean
- Whether the preferredSize should automatically be updated when the text is changed. This option sets the autoAdjustPreferredSize property on the created object.
- shareStyleInstance - boolean
- A value indicating whether the label style instance should be shared referentially or cloned. This option sets the shareStyleInstance property on the created object.
- layoutParameter - ILabelModelParameter
- The ILabelModelParameter to use when initializing the folding labels. This option sets the layoutParameter property on the created object.
Properties
Gets or sets whether the preferredSize should automatically be updated when the text is changed.
Remarks
Gets or sets what properties to initialize the FoldingLabelState with when a folding label is added to the owner for the first time.
Remarks
Gets or sets the ILabelModelParameter to use when initializing the folding labels.
Remarks
null
(the default) will leave the model parameter property unmodified.Gets or sets the ILabelStyle to use when initializing the folding labels.
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 FoldingLabelState with when a folding label is updated to reflect changes made to its master item.
Remarks
See Also
Gets or sets what properties to backpropagate from the FoldingLabelState when a master label is updated to reflect changes made to its folding variant.
Remarks
See Also
Methods
addLabel
(ownerState: FoldingLabelOwnerState, masterLabel: ILabel, text: string, parameter: ILabelModelParameter, style: ILabelStyle, preferredSize: Size, tag: any) : FoldingLabelStateSimple callback method that delegates to addLabel
Parameters
A map of options to pass to the method.
- ownerState - FoldingLabelOwnerState
- The state to use for adding the label
- masterLabel - ILabel
- The label to create a representative for.
- text - string
- The text to use for the label.
- parameter - ILabelModelParameter
- The optional parameter to use.
- style - ILabelStyle
- The optional style to use
- preferredSize - Size
- The optional preferred size to use.
- tag - any
- The optional tag to use.
Returns
- ↪FoldingLabelState?
- The label to create. May be
null
if the label was omitted.
Creates the default ILabelStyle to use in initializeState.
Returns
- ↪ILabelStyle?
- 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 edge.
Called by implementations of the IFolderNodeConverter and IFoldingEdgeConverter interfaces to initialize the state of a label in the folding view.
Remarks
Parameters
A map of options to pass to the method.
- state - FoldingLabelOwnerState
- The state object to use for initializing the labels.
- masterLabel - ILabel
- The label this folding label represents.
See Also
Called in response to updateGroupNodeState and updateMasterEdges to optionally update the various properties on the master label according to the state of the folding label.
Parameters
A map of options to pass to the method.
- masterGraph - IGraph
- The master graph to use for modifying the
masterLabel
. - state - FoldingLabelState
- The state of the folding label.
- masterLabel - ILabel
- The master label to potentially synchronize the state for.
See Also
Called by implementations of the IFolderNodeConverter and IFoldingEdgeConverter interfaces to update the state of a label in the folding view, once it has changed.
Remarks
Parameters
A map of options to pass to the method.
- state - FoldingLabelState
- The state object to use for modifying the properties.
- masterLabel - ILabel
- The master label this label represents.