C

FoldingEdgeState

A data container representing the state of an edge whose source and/or target node are collapsed.

Remarks

When the properties of the state are changed, these changes are reflected immediately in the views.

This class cannot be instantiated

Examples

const state = manager.getFoldingEdgeState(
  new FoldingEdgeStateId(
    masterEdge,
    masterSource,
    true,
    masterTarget,
    false,
  ),
)
state.style = new PolylineEdgeStyle({ stroke: Stroke.RED })
const state = manager.getFoldingEdgeState(
  new FoldingEdgeStateId(
    masterEdge,
    masterSource,
    true,
    masterTarget,
    false,
  ),
)
const portState = state.sourcePort
portState.locationParameter = FreeNodePortLocationModel.RIGHT

See Also

Developer's Guide

API

FoldingEdgeStateId, getFoldingEdgeState

Members

Show:

Properties

Gets the FoldingBendStates of this state.
readonlyfinal
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'
Gets the FoldingPortState which represents the source port of this edge state.
readonlyfinal
Gets or sets the style of this edge.
final
Gets or sets the tag of the edge.
final
Gets the FoldingPortState which represents the target port of this edge state.
readonlyfinal

Methods

Adds a new FoldingBendState to this edge state at the given index and location.
final

Parameters

location: Point
The location of the new bend state.
index?: number
The index the bend state shall be inserted in the bends; a negative value (which is the default) indicates that the bend should be appended to the end of the list of bends.

Return Value

FoldingBendState
The newly added bend state.

Throws

Exception ({ name: 'ArgumentError' })
location contains one or more NaN values.
Adds a FoldingLabelState to this state.
final

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.
Returns an IEdge instance which represents this edge state.
The returned edge is not present in any graph but may be passed to getViewItem to get the edge state's view edge in the folding view graph.
final

Return Value

IEdge
An IEdge instance which represents this edge state.
Removes all bends.
final
Removes all labels.
Removes the bend from this edge state.
final

Parameters

bend: FoldingBendState
The bend to remove.

Throws

Exception ({ name: 'ArgumentError' })
Thrown if the bend doesn't belong to this edge state.
Removes the label from its owning FoldingLabelOwnerState.
final

Parameters

label: FoldingLabelState
The label to remove.