Packagecom.yworks.graph.model
Classpublic class DefaultDummyNodeConverter
InheritanceDefaultDummyNodeConverter Inheritance Object
Implements IDummyNodeConverter

Simple default implementation of the IDummyNodeConverter interface that is used by the FoldingManager's dummyNodeConverter property.

This class has a couple of properties that can be adjusted to customize the behavior. Also, it contains a number of callback methods for conveniently overriding the implementation in custom sub classes.

See also

FoldingManager
FoldingManager.dummyNodeConverter
IDummyNodeConverter
DefaultDummyEdgeConverter


Public Properties
 PropertyDefined By
  cloneNodeStyle : Boolean
Indicates whether the collapsedNodeStyle instance should be assigned as a clone or not.
DefaultDummyNodeConverter
  clonePortStyle : Boolean
Indicates whether the portStyle instance should be assigned as a clone or not.
DefaultDummyNodeConverter
  collapsedNodeStyle : INodeStyle
The INodeStyle to use for the collapsed group nodes.
DefaultDummyNodeConverter
  copyFirstLabel : Boolean
A value indicating whether the first label of the master group node should be recreated for the collapsed group node instance.
DefaultDummyNodeConverter
  firstLabelModelParamater : ILabelModelParameter
[read-only] Gets or sets the ILabelModelParameter to use for the first label of the collapsed group node.
DefaultDummyNodeConverter
  firstLabelModelParameter : ILabelModelParameter
[write-only]
DefaultDummyNodeConverter
  firstLabelStyle : ILabelStyle
The ILabelStyle to use for the first label of the collapsed group nodes.
DefaultDummyNodeConverter
  initialSize : ISize
The initial size of the layout of the collapsed group node that will be assigned during the creation of the appearance of the collapsed group node.
DefaultDummyNodeConverter
  portStyle : IPortStyle
Gets or sets the IPortStyle to use for the ports at the collapsed group node that represent the ports of the master node in the collapsed state.
DefaultDummyNodeConverter
  resetPortLocation : Boolean
Indicates whether to reset the location of dummy ports to the center of the node.
DefaultDummyNodeConverter
Public Methods
 MethodDefined By
  
changeDummyNodeAppearance(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, dummyNode:INode, masterNode:INode):void
Callback that is used by IFoldedGraph view implementations to change the appearance of a dummy node.
DefaultDummyNodeConverter
  
createDummyNodeAppearance(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, dummyNode:INode, masterNode:INode):void
Callback that is used by IFoldedGraph view implementations to initially create the appearance of a dummy node.
DefaultDummyNodeConverter
Protected Methods
 MethodDefined By
  
createInitialLabels(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void
Callback method that initializes the initial labels of the collapsed group node.
DefaultDummyNodeConverter
  
createInitialLayout(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void
Callback method that initializes the layout of the collapsed group node.
DefaultDummyNodeConverter
  
createInitialPorts(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void
Called by createDummyNodeAppearance() to initalize the appearance of the representatives of the master ports at the collapsed group node.
DefaultDummyNodeConverter
  
createInitialStyle(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void
Callback method that initializes the style of the collapsed group node.
DefaultDummyNodeConverter
  
createNodeStyle(foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):INodeStyle
Callback factory method that creates the INodeStyle for use in createInitialStyle().
DefaultDummyNodeConverter
  
createPortStyle(foldedGraph:IFoldedGraph, localPort:IPort, masterPort:IPort):IPortStyle
Callback factory method that creates the IPortStyle for use in createInitialPorts().
DefaultDummyNodeConverter
  
synchronizeLabels(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void
Called by changeDummyNodeAppearance to synchronize the first label if copyFirstLabel is enabled.
DefaultDummyNodeConverter
Property Detail
cloneNodeStyleproperty
cloneNodeStyle:Boolean

Indicates whether the collapsedNodeStyle instance should be assigned as a clone or not.

Set this property to true if the dummy node style should be cloned; otherwise, set it to false.

The default value is false.


Implementation
    public function get cloneNodeStyle():Boolean
    public function set cloneNodeStyle(value:Boolean):void

See also

clonePortStyleproperty 
clonePortStyle:Boolean

Indicates whether the portStyle instance should be assigned as a clone or not.

Set this property to true if the port style should be cloned; otherwise, set it to false.

The default value is false.


Implementation
    public function get clonePortStyle():Boolean
    public function set clonePortStyle(value:Boolean):void

See also

collapsedNodeStyleproperty 
collapsedNodeStyle:INodeStyle

The INodeStyle to use for the collapsed group nodes.

Depending on the cloneNodeStyle property this implementation will assign a clone to the property or this instance.

A value of null will leave the style property unmodified.


Implementation
    public function get collapsedNodeStyle():INodeStyle
    public function set collapsedNodeStyle(value:INodeStyle):void

See also

copyFirstLabelproperty 
copyFirstLabel:Boolean

A value indicating whether the first label of the master group node should be recreated for the collapsed group node instance.

This setting can be used to initially create a copy of the first label of the master group node (if any) and subsequently synchronize the ILabel#text property with the master's node label text. Set it to true if the first label should be copied; otherwise, false.

The default value is false.


Implementation
    public function get copyFirstLabel():Boolean
    public function set copyFirstLabel(value:Boolean):void

See also

firstLabelModelParamaterproperty 
firstLabelModelParamater:ILabelModelParameter  [read-only]

Gets or sets the ILabelModelParameter to use for the first label of the collapsed group node.

This will only affect the dummy node if the copyFirstLabel property is set to true.

A value of null will leave the label model parameter property unmodified.

The default value is null.


Implementation
    public function get firstLabelModelParamater():ILabelModelParameter

See also

firstLabelModelParameterproperty 
firstLabelModelParameter:ILabelModelParameter  [write-only]


Implementation
    public function set firstLabelModelParameter(value:ILabelModelParameter):void
firstLabelStyleproperty 
firstLabelStyle:ILabelStyle

The ILabelStyle to use for the first label of the collapsed group nodes.

This will only affect the collapsed group node if the copyFirstLabel property is set to true.

A value of null will leave the style property unmodified.

The default value is null.


Implementation
    public function get firstLabelStyle():ILabelStyle
    public function set firstLabelStyle(value:ILabelStyle):void

See also

initialSizeproperty 
initialSize:ISize

The initial size of the layout of the collapsed group node that will be assigned during the creation of the appearance of the collapsed group node.

Since the layout of an expanded group node normally encompasses the child nodes, it will have quite a large size. Since the contents of a collapsed group node are not visible, there is no need for the collapsed group node to encompass the area of its children. Thus the size can be different and most of the time should be smaller. Setting this property to non-null values will make the initial layout of the collapsed node become the given size assigned. The default is null


Implementation
    public function get initialSize():ISize
    public function set initialSize(value:ISize):void

See also

portStyleproperty 
portStyle:IPortStyle

Gets or sets the IPortStyle to use for the ports at the collapsed group node that represent the ports of the master node in the collapsed state.

Since the appearance of the collapsed group node may totally differ from the appearance of the expanded group node, the appearance of the ports may also be different. This property can be used to assign a different specific style to the ports if the node is in collapsed state. A value of null will leave the style property unmodified. The default is null


Implementation
    public function get portStyle():IPortStyle
    public function set portStyle(value:IPortStyle):void

See also

resetPortLocationproperty 
resetPortLocation:Boolean

Indicates whether to reset the location of dummy ports to the center of the node.

The default is false true if the location should initially be reset to the center of the node; otherwise, false.


Implementation
    public function get resetPortLocation():Boolean
    public function set resetPortLocation(value:Boolean):void

See also

Method Detail
changeDummyNodeAppearance()method
public function changeDummyNodeAppearance(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, dummyNode:INode, masterNode:INode):void

Callback that is used by IFoldedGraph view implementations to change the appearance of a dummy node.

This method is called by the view to allow for adjusting the appearance of a local dummy node in the view when the master node for it has changed properties. This can be used, e.g. to synchronize the label or style properties with the corresponding properties of the masterNode. Note that changing the appearance has to be done using the callback that implements the IChangeDummyNodeAppearanceCallback interface. Direct changes to the dummyNode would otherwise be enqueued into the undo queue and could thus break the undo stack.

Parameters

callback:IChangeDummyNodeAppearanceCallback — The callback to use for changing the appearance.
 
foldedGraph:IFoldedGraph — The graph instance for which the dummy node can be changed.
 
dummyNode:INode — The dummy node instance in the view
 
masterNode:INode — The node that represents the master item that is represented in the local view by the dummyNode.

createDummyNodeAppearance()method 
public function createDummyNodeAppearance(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, dummyNode:INode, masterNode:INode):void

Callback that is used by IFoldedGraph view implementations to initially create the appearance of a dummy node.

This method is called by the view to allow for initially creating the appearance of a local dummy node in the view when it is included in the view for the first time. This can be used, e.g. to initialize the labels or style properties with the corresponding properties of the masterNode. Note that changing the appearance has to be done using the callback that implements the IChangeDummyNodeAppearanceCallback interface. Direct changes to the dummyNode would otherwise be enqueued into the undo queue and could thus break the undo stack.

Parameters

callback:IChangeDummyNodeAppearanceCallback — The callback to use for determining the appearance.
 
foldedGraph:IFoldedGraph — The graph instance for which the dummy node has been created.
 
dummyNode:INode — The dummy node instance in the view
 
masterNode:INode — The node that represents the master item that is represented in the local view by the dummyNode.

createInitialLabels()method 
protected function createInitialLabels(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void

Callback method that initializes the initial labels of the collapsed group node.

This will try to copy the first label of the master node if copyFirstLabel is enabled.

Parameters

callback:IChangeDummyNodeAppearanceCallback — The callback.
 
foldedGraph:IFoldedGraph — The folded graph instance that has triggered the CreateDummyNodeAppearance() call.
 
localCollapsedNode:INode — The collapsed group node in the view that may be changed using the callback.
 
masterNode:INode — The master node that the dummy node represents.

See also

createInitialLayout()method 
protected function createInitialLayout(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void

Callback method that initializes the layout of the collapsed group node.

This implementation will set the nodes' bounds in such a way that the size will be that of the initialSize property (if non-null) but not smaller than the minimum size that is reported by a potential ISizeConstraintProvider for INodes that has been found in the lookup of the localCollapsedNode.

Parameters

callback:IChangeDummyNodeAppearanceCallback — The callback to use for IChangeDummyNodeAppearanceCallback#setBounds()
 
foldedGraph:IFoldedGraph — The folded graph instance.
 
localCollapsedNode:INode — The local collapsed group node to change.
 
masterNode:INode — The master node that is represented by the local group node.

See also

createInitialPorts()method 
protected function createInitialPorts(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void

Called by createDummyNodeAppearance() to initalize the appearance of the representatives of the master ports at the collapsed group node.

This method will call createPortStyle() for each port at the group node and assign the returned style if it is non-null. If resetPortLocation is enabled, the ports' location will be reset to the center of the node's layout.

Parameters

callback:IChangeDummyNodeAppearanceCallback — The callback to use for IChangeDummyNodeAppearanceCallback#setPortStyle() and IChangeDummyNodeAppearanceCallback#setPortLocation().
 
foldedGraph:IFoldedGraph — The folded graph instance.
 
localCollapsedNode:INode — The local group node.
 
masterNode:INode — The master group node.

See also

createInitialStyle()method 
protected function createInitialStyle(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void

Callback method that initializes the style of the collapsed group node.

This implementation calls createNodeStyle() and sets the style of the group node if a non-null value has been returned.

Parameters

callback:IChangeDummyNodeAppearanceCallback — The callback.
 
foldedGraph:IFoldedGraph — The folded graph instance that has triggered the createDummyNodeAppearance() call.
 
localCollapsedNode:INode — The local node in the view that may be changed using the callback.
 
masterNode:INode — The master node that the local dummy node represents.

See also

createNodeStyle()method 
protected function createNodeStyle(foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):INodeStyle

Callback factory method that creates the INodeStyle for use in createInitialStyle().

Parameters

foldedGraph:IFoldedGraph — The folded graph instance.
 
localCollapsedNode:INode — The local dummy node in the view whose INode#style should be initialized.
 
masterNode:INode — The node that is being represented by the dummy node.

Returns
INodeStyle — The collapsedNodeStyle or a clone of it depending on the cloneNodeStyle property. This method may return null to indicate that the default style should not be changed.
createPortStyle()method 
protected function createPortStyle(foldedGraph:IFoldedGraph, localPort:IPort, masterPort:IPort):IPortStyle

Callback factory method that creates the IPortStyle for use in createInitialPorts().

Parameters

foldedGraph:IFoldedGraph — The folded graph instance.
 
localPort:IPort — The local port in the view whose IPort#style should be initialed.
 
masterPort:IPort — The port that is being represented by the dummy port.

Returns
IPortStyle — The portStyle or a clone of it depending on the clonePortStyle property. This method may return null to indicate that the default style should not be changed.
synchronizeLabels()method 
protected function synchronizeLabels(callback:IChangeDummyNodeAppearanceCallback, foldedGraph:IFoldedGraph, localCollapsedNode:INode, masterNode:INode):void

Called by changeDummyNodeAppearance to synchronize the first label if copyFirstLabel is enabled.

This will adjust the label text property or remove the label if there is no more master label.

Parameters

callback:IChangeDummyNodeAppearanceCallback — The callback.
 
foldedGraph:IFoldedGraph — The folded graph.
 
localCollapsedNode:INode — The local node instance.
 
masterNode:INode — The master node.

See also