A data container representing the collapsed state of a node.
Inheritance Hierarchy
FoldingLabelOwnerState
FolderNodeState
Remarks
When the properties of the state are changed, these changes are reflected immediately in the views.
Examples
const state = manager.getFolderNodeState(masterNode)
state.style = new GroupNodeStyle()
const state = manager.getFolderNodeState(masterNode)
const labelState = state.labels.get(0)
labelState.text = 'New Label Text'
const state = manager.getFolderNodeState(masterNode)
const style = new DefaultLabelStyle()
state.addLabel(
'Folder Label',
InteriorLabelModel.NORTH_EAST,
style,
new Size(20, 10),
null
)
Type Details
- yfiles module
- view-folding
- yfiles-umd modules
- view-folding, view-graphml, view
- Legacy UMD name
- yfiles.graph.FolderNodeState
See Also
Properties
Gets the FoldingLabelStates owned by this state.
Examples
const state = manager.getFolderNodeState(masterNode)
const labelState = state.labels.get(0)
labelState.text = 'New Label Text'
const state = manager.getFolderNodeState(masterNode)
const labelState = state.labels.get(0)
labelState.text = 'New Label Text'
Defined in
Gets or sets the layout of the node.
Throws
- Exception({ name: 'ArgumentError' })
value
contains one or more NaN values.
Gets the FoldingPortStates owned by this state.
Examples
const state = manager.getFolderNodeState(masterNode)
const portState = state.ports.get(0)
portState.locationParameter = FreeNodePortLocationModel.NODE_TOP_ANCHORED
Gets or sets the style of this node.
Examples
const state = manager.getFolderNodeState(masterNode)
state.style = new GroupNodeStyle()
Methods
addLabel
(text: string, layoutParameter: ILabelModelParameter, style: ILabelStyle, preferredSize: Size, tag: Object) : FoldingLabelStateAdds a FoldingLabelState to this state.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- text - string
- The text of the new label.
- layoutParameter - ILabelModelParameter
- The layout parameter of the new label.
- style - ILabelStyle
- The style of the new label.
- preferredSize - Size
- The preferred size of the label.
- tag - Object
- The tag of the label.
Returns
- ↪FoldingLabelState
- The newly added FoldingLabelState.
Implements
Returns an INode instance which represents this folder node state.
Remarks
The returned node is not present in any graph but may be passed to getViewItem to get the node state's folder node in the folding view graph.
Returns
Removes all labels.
Defined in
Provides access to the folding state of a master port.
Remarks
This method can be used to query the folding state of a port at the folder which is represented by this state.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- masterPort - IPort
- The master port for which the state should be returned.
Returns
- ↪FoldingPortState
- A state holder implementation of the
masterPort
, which reflects the port in the node's collapsed state.
See Also
Removes the label
from its owning FoldingLabelOwnerState.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- label - FoldingLabelState
- The label to remove.