Package | com.yworks.graph.model |
Class | public class AbstractDummyEdgeConverter |
Inheritance | AbstractDummyEdgeConverter Object |
Implements | IDummyEdgeConverter |
Subclasses | DefaultDummyEdgeConverter, MergingDummyEdgeConverter |
IDummyEdgeConverter
interface that may be subclassed to create a customized FoldingManager#dummyEdgeConverter
.
This class provides default mechanisms and callbacks that can be used
to set another style for dummy edges, for the ports of dummy edges,
synchronizing the first label of a dummy edge with the master edge, etc.
Subclasses need to implement the addDummyEdge()
method, only.
See also
Property | Defined By | ||
---|---|---|---|
cloneEdgeStyle : Boolean
Indicates whether the dummyEdgeStyle instance should
be assigned as a clone or not. | AbstractDummyEdgeConverter | ||
copyFirstLabel : Boolean
Indicates whether the first label of the master edge
should be recreated for the dummy edge. | AbstractDummyEdgeConverter | ||
dummyEdgeStyle : IEdgeStyle
Gets or sets the IEdgeStyle to use for the dummy edge. | AbstractDummyEdgeConverter | ||
dummySourcePortStyle : IPortStyle
Gets or sets the IPortStyle to use for the dummy source port. | AbstractDummyEdgeConverter | ||
dummyTargetPortStyle : IPortStyle
Gets or sets the IPortStyle to use for the dummy target port. | AbstractDummyEdgeConverter | ||
firstLabelModelparameter : ILabelModelParameter [read-only]
Gets or sets the ILabelModelParameter to use for the first label of the dummy edge. | AbstractDummyEdgeConverter | ||
firstLabelModelParameter : ILabelModelParameter [write-only] | AbstractDummyEdgeConverter | ||
firstLabelStyle : ILabelStyle
Gets or sets the ILabelStyle to use for the first label of the dummy edge. | AbstractDummyEdgeConverter | ||
resetBends : Boolean
Indicates whether to reset and clear the bends of a dummy edge initially. | AbstractDummyEdgeConverter | ||
resetDummyPorts : Boolean
Indicates whether to reset the location of dummy ports to the
center of the node. | AbstractDummyEdgeConverter |
Method | Defined By | ||
---|---|---|---|
addDummyEdge(callback:IAddDummyEdgeCallback, foldedGraph:IFoldedGraph, masterEdge:IEdge, localSourceNode:INode, sourceDummy:Boolean, localTargetNode:INode, targetDummy:Boolean):IEdge
Subclasses have to override this method. | AbstractDummyEdgeConverter | ||
changeDummyEdgeAppearance(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, localDummyEdge:IEdge, masterEdges:List):void
Callback that is triggered by the IFoldedGraph view to adjust the appearance of a dummy edge, e.g. | AbstractDummyEdgeConverter | ||
createDummyEdgeAppearance(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, localDummyEdge:IEdge, masterEdges:List):void
Callback that is triggered by the IFoldedGraph view to initially create
the appearance of a dummy edge. | AbstractDummyEdgeConverter |
Method | Defined By | ||
---|---|---|---|
Callback factory method that creates the IEdgeStyle for use
in createInitialStyle(). | AbstractDummyEdgeConverter | ||
createInitialBends(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Callback method that initializes the bends
of the dummy edge. | AbstractDummyEdgeConverter | ||
createInitialLabels(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Callback method that initializes the initial labels
of the dummy edge. | AbstractDummyEdgeConverter | ||
createInitialPorts(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Callback method that initializes the ports
of the dummy edge. | AbstractDummyEdgeConverter | ||
createInitialStyle(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Callback method that initializes the style
of the dummy edge. | AbstractDummyEdgeConverter | ||
createSourcePortLocationParameter(graph:IFoldedGraph, edge:IEdge, masterEdges:List):IPortLocationModelParameter
Callback method that creates the source port location parameter. | AbstractDummyEdgeConverter | ||
createTargetPortLocationParameter(graph:IFoldedGraph, edge:IEdge, masterEdges:List):IPortLocationModelParameter
Callback method that creates the target port location parameter. | AbstractDummyEdgeConverter | ||
synchronizeLabels(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Called by changeDummyEdgeAppearance to synchronize the first label if copyFirstLabel
is enabled. | AbstractDummyEdgeConverter |
cloneEdgeStyle | property |
cloneEdgeStyle:Boolean
Indicates whether the dummyEdgeStyle
instance should
be assigned as a clone or not.
Set this property to true
, if the dummy edge style should be cloned.
Otherwise, set it to false
.
The default value is false;
.
public function get cloneEdgeStyle():Boolean
public function set cloneEdgeStyle(value:Boolean):void
copyFirstLabel | property |
copyFirstLabel:Boolean
Indicates whether the first label of the master edge should be recreated for the dummy edge.
This setting can be used to initially create a copy of the first label of the master edge (if any) and
subsequently synchronize the ILabel#text
property with the master's edge label text.
Set this value to true
if the first label should be copied; otherwise, set it to false
.
public function get copyFirstLabel():Boolean
public function set copyFirstLabel(value:Boolean):void
See also
dummyEdgeStyle | property |
dummyEdgeStyle:IEdgeStyle
Gets or sets the IEdgeStyle
to use for the dummy edge.
Depending on the cloneEdgeStyle
property this implementation will
assign a clone to the property or this instance.
A value of null
will leave the style property unmodified.
public function get dummyEdgeStyle():IEdgeStyle
public function set dummyEdgeStyle(value:IEdgeStyle):void
dummySourcePortStyle | property |
dummySourcePortStyle:IPortStyle
Gets or sets the IPortStyle
to use for the dummy source port.
A value of null
will leave the style property unmodified.
public function get dummySourcePortStyle():IPortStyle
public function set dummySourcePortStyle(value:IPortStyle):void
dummyTargetPortStyle | property |
dummyTargetPortStyle:IPortStyle
Gets or sets the IPortStyle
to use for the dummy target port.
A value of null
will leave the style property unmodified.
public function get dummyTargetPortStyle():IPortStyle
public function set dummyTargetPortStyle(value:IPortStyle):void
firstLabelModelparameter | property |
firstLabelModelparameter:ILabelModelParameter
[read-only]
Gets or sets the ILabelModelParameter
to use for the first label of the dummy edge.
This will only affect the dummy edge if the copyFirstLabel
property is set to true
.
A value of null
will leave the label model parameter property unmodified.
public function get firstLabelModelparameter():ILabelModelParameter
firstLabelModelParameter | property |
firstLabelModelParameter:ILabelModelParameter
[write-only] public function set firstLabelModelParameter(value:ILabelModelParameter):void
firstLabelStyle | property |
firstLabelStyle:ILabelStyle
Gets or sets the ILabelStyle
to use for the first label of the dummy edge.
This will only affect the dummy edge if the copyFirstLabel
property is set to true
.
A value of null
will leave the style property unmodified.
public function get firstLabelStyle():ILabelStyle
public function set firstLabelStyle(value:ILabelStyle):void
resetBends | property |
resetBends:Boolean
Indicates whether to reset and clear the bends of a dummy edge initially.
Set this value to true
if the dummy edge should initially not contain any bends; otherwise, set it to false
public function get resetBends():Boolean
public function set resetBends(value:Boolean):void
resetDummyPorts | property |
resetDummyPorts:Boolean
Indicates whether to reset the location of dummy ports to the center of the node.
Set this property to true
if the location should initially be reset to the center of the node; otherwise, set it to false
.
public function get resetDummyPorts():Boolean
public function set resetDummyPorts(value:Boolean):void
addDummyEdge | () | method |
public function addDummyEdge(callback:IAddDummyEdgeCallback, foldedGraph:IFoldedGraph, masterEdge:IEdge, localSourceNode:INode, sourceDummy:Boolean, localTargetNode:INode, targetDummy:Boolean):IEdge
Subclasses have to override this method.
This method is called by theIFoldedGraph
implementation to determine
whether a given edge in the FoldingManager
's masterGraph
should be represented by a dummy edge in the given view.
The implementation will be passed in a callback object that implements the IAddDummyEdgeCallback
interface, which needs to be used by the implementation to communicate the result of the query.
The implementation needs to either call IAddDummyEdgeCallback.addAsSeparateEdge()
,
IAddDummyEdgeCallback.addToExistingDummy()
, or IAddDummyEdgeCallback.excludeDummyEdge()
and return
the values that these implementation yields to the caller.
The implementation can optionally query the existing dummy edges
between the source and target node
using IAddDummyEdgeCallback.getExistingDummyEdges()
and decide whether to add the edge to the existing dummy.
Parameters
callback:IAddDummyEdgeCallback — The IAddDummyEdgeCallback implementation that needs to be called in order to
communicate the results of this query.
| |
foldedGraph:IFoldedGraph — The instance into which the dummy edge is going to be inserted.
| |
masterEdge:IEdge — The edge from the FoldingManager 's masterGraph that needs to
be represented by a dummy edge. Note that you may not return this instance.
| |
localSourceNode:INode — The source node that belongs to the IFoldedGraph view that will act as the local
representative of the actual source node.
| |
sourceDummy:Boolean — Whether the localSourceNode is currently a dummy node.
| |
localTargetNode:INode — The target node that belongs to the IFoldedGraph view that will act as the local
representative of the actual target node.
| |
targetDummy:Boolean — Whether the localTargetNode is currently a dummy node.
|
IEdge — The edge as returned by IAddDummyEdgeCallback.addAsSeparateEdge() ,
or IAddDummyEdgeCallback.addToExistingDummy ,
or null , if the edge will be excluded from the view.
|
changeDummyEdgeAppearance | () | method |
public function changeDummyEdgeAppearance(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, localDummyEdge:IEdge, masterEdges:List):void
Callback that is triggered by the IFoldedGraph
view to adjust the appearance of a dummy edge, e.g. to
reflect a state change in the master edges that make up that dummy edge.
Implementations may not use the IFoldedGraph
's graph
instance to modify
the localDummyEdge
, because this would create and enqueue undo events. Rather
the callbacks provided by the callback
's IChangeDummyEdgeAppearanceCallback
implementation must be used.
Parameters
callback:IChangeDummyEdgeAppearanceCallback — The callback to use for changing the appearance.
| |
foldedGraph:IFoldedGraph — The graph to which the dummy edge belongs.
| |
localDummyEdge:IEdge — The dummy edge for which the appearance might need an update.
| |
masterEdges:List — The list of master edges, that the dummy edge currently represents.
|
createDummyEdgeAppearance | () | method |
public function createDummyEdgeAppearance(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, localDummyEdge:IEdge, masterEdges:List):void
Callback that is triggered by the IFoldedGraph
view to initially create
the appearance of a dummy edge.
Implementations may not use the IFoldedGraph
's graph
instance to modify
the localDummyEdge
, because this would create and enqueue undo events. Rather
the callbacks provided by the callback
's IChangeDummyEdgeAppearanceCallback
implementation must be used.
Parameters
callback:IChangeDummyEdgeAppearanceCallback — The callback to use for changing the appearance.
| |
foldedGraph:IFoldedGraph — The graph to which the dummy edge belongs.
| |
localDummyEdge:IEdge — The dummy edge for which the appearance shall be determined.
| |
masterEdges:List — The list of master edges, that the dummy edge initially represents.
|
createEdgeStyle | () | method |
protected function createEdgeStyle(foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):IEdgeStyle
Callback factory method that creates the IEdgeStyle
for use
in createInitialStyle()
.
Parameters
foldedGraph:IFoldedGraph — The folded graph instance.
| |
dummyEdge:IEdge — The dummy edge in the view whose style should be initialed.
| |
masterEdges:List — The edges that are being represented by the dummy edge.
|
IEdgeStyle — The DummyEdgeStyle or a clone of it,
depending on the cloneEdgeStyle property. This method may return null
to indicate that the default style should not be changed.
|
createInitialBends | () | method |
protected function createInitialBends(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Callback method that initializes the bends of the dummy edge.
This will call the
callback
's clearBends
,
if resetBends
is enabled.
Parameters
callback:IChangeDummyEdgeAppearanceCallback — The callback.
| |
foldedGraph:IFoldedGraph — The folded graph instance that has triggered the createDummyEdgeAppearance() call.
| |
dummyEdge:IEdge — The dummy edge in the view that may be changed using the callback .
| |
masterEdges:List — The master edges that the dummy edge represents.
|
createInitialLabels | () | method |
protected function createInitialLabels(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Callback method that initializes the initial labels of the dummy edge.
This will try to copy the first label of the single master edge if copyFirstLabel
is enabled.
Parameters
callback:IChangeDummyEdgeAppearanceCallback — The callback.
| |
foldedGraph:IFoldedGraph — The folded graph instance that has triggered the createDummyEdgeAppearance call.
| |
dummyEdge:IEdge — The dummy edge in the view that may be changed using the callback .
| |
masterEdges:List — The master edges that the dummy edge represents.
|
See also
createInitialPorts | () | method |
protected function createInitialPorts(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Callback method that initializes the ports of the dummy edge.
Parameters
callback:IChangeDummyEdgeAppearanceCallback — The callback.
| |
foldedGraph:IFoldedGraph — The folded graph instance that has triggered the CreateDummyEdgeAppearance() call.
| |
dummyEdge:IEdge — The dummy edge in the view that may be changed using the callback .
| |
masterEdges:List — The master edges that the dummy edge represents.
|
See also
createInitialStyle | () | method |
protected function createInitialStyle(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Callback method that initializes the style of the dummy edge.
This implementation calls createEdgeStyle()
and sets
the style to the dummy edge if a non-null
value has been returned.
Parameters
callback:IChangeDummyEdgeAppearanceCallback — The callback.
| |
foldedGraph:IFoldedGraph — The folded graph instance that has triggered the createDummyEdgeAppearance() call.
| |
dummyEdge:IEdge — The dummy edge in the view that may be changed using the callback .
| |
masterEdges:List — The master edges that the dummy edge represents.
|
createSourcePortLocationParameter | () | method |
protected function createSourcePortLocationParameter(graph:IFoldedGraph, edge:IEdge, masterEdges:List):IPortLocationModelParameter
Callback method that creates the source port location parameter.
Parameters
graph:IFoldedGraph — The graph.
| |
edge:IEdge — The edge to create the parameter for.
| |
masterEdges:List — The master edges.
|
IPortLocationModelParameter — The parameter to use.
|
createTargetPortLocationParameter | () | method |
protected function createTargetPortLocationParameter(graph:IFoldedGraph, edge:IEdge, masterEdges:List):IPortLocationModelParameter
Callback method that creates the target port location parameter.
Parameters
graph:IFoldedGraph — The graph.
| |
edge:IEdge — The edge to create the parameter for.
| |
masterEdges:List — The master edges.
|
IPortLocationModelParameter — The parameter to use.
|
synchronizeLabels | () | method |
protected function synchronizeLabels(callback:IChangeDummyEdgeAppearanceCallback, foldedGraph:IFoldedGraph, dummyEdge:IEdge, masterEdges:List):void
Called by changeDummyEdgeAppearance
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 or there is more than one master edge.
Parameters
callback:IChangeDummyEdgeAppearanceCallback — The callback.
| |
foldedGraph:IFoldedGraph — The folded graph.
| |
dummyEdge:IEdge — The dummy edge.
| |
masterEdges:List — The master edges.
|