A data container representing the state of a port at a FolderNodeState or FoldingEdgeState.
Inheritance Hierarchy
Remarks
When the properties of the state are changed, these changes are reflected immediately in the views.
This class cannot be instantiated
Examples
Ports at folder nodes should be retrieved from the ports collection of its owner.
const state = manager.getFolderNodeState(masterNode)
const portState = state.ports.get(0)
portState.locationParameter = FreeNodePortLocationModel.TOPThe source and target ports of an edge should be retrieved from the sourcePort and targetPort properties of the edge.
const state = manager.getFoldingEdgeState(
new FoldingEdgeStateId(
masterEdge,
masterSource,
true,
masterTarget,
false,
),
)
const portState = state.sourcePort
portState.locationParameter = FreeNodePortLocationModel.RIGHTSee Also
Developer's Guide
API
- sourcePort, targetPort, ports, getFoldingPortState
Members
Show:
Properties
Gets the FoldingLabelStates owned by this state.
Gets the FoldingLabelStates owned by this state.
readonly
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
FoldingLabelOwnerState.labelsGets or sets the IPortLocationModelParameter describing the position of this port.
Gets or sets the IPortLocationModelParameter describing the position of this port.
Gets or sets the style of this port.
Gets or sets the style of this port.
Gets the type of port this state represents.
Gets the type of port this state represents.
Methods
Adds a FoldingLabelState to this state.
Adds a FoldingLabelState to this state.
abstract
Parameters
- 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?: ILabel['tag']
- The tag of the label.
Return Value
- FoldingLabelState
- The newly added FoldingLabelState.
Examples
const state = manager.getFolderNodeState(masterNode)
const style = new LabelStyle()
state.addLabel(
'Folder Label',
InteriorNodeLabelModel.TOP_RIGHT,
style,
new Size(20, 10),
)Defined in
FoldingLabelOwnerState.addLabelThe returned port is not present in any graph but may be passed to getViewItem to get the port state's view port in the folding view graph.
abstract
Return Value
Removes all labels.
Removes all labels.
Defined in
FoldingLabelOwnerState.clearLabelsRemoves the label from its owning FoldingLabelOwnerState.
Removes the
label from its owning FoldingLabelOwnerState.abstract
Parameters
- label: FoldingLabelState
- The label to remove.