Packagecom.yworks.graph.model
Classpublic class GraphSelection
InheritanceGraphSelection Inheritance flash.events.EventDispatcher
Implements IGraphSelection

Simple implementation of the IGraphSelection interface, which manages the selection state of items in an IGraph instance.

See also

IGraphSelection


Public Properties
 PropertyDefined By
  count : uint
[read-only] The number of all selected items.
GraphSelection
  graph : IGraph
Gets or sets the IGraph this instance is using as the domain for the selection.
GraphSelection
  selectedBends : Iterable
[read-only] Enumerates all currently selected bends.
GraphSelection
  selectedEdges : Iterable
[read-only] Enumerates all currently selected edges.
GraphSelection
  selectedLabels : Iterable
[read-only] Enumerates all currently selected labels.
GraphSelection
  selectedNodes : Iterable
[read-only] Enumerates all currently selected nodes.
GraphSelection
  selectedObjects : Iterable
[read-only] Gets an Iterable of all selected Objects.
GraphSelection
  selectedPorts : Iterable
[read-only] Enumerates all currently selected ports.
GraphSelection
Public Methods
 MethodDefined By
  
GraphSelection(graph:IGraph = null)
Instanciates an instance using the the graph as the model.
GraphSelection
  
clear():void
Deselect all.
GraphSelection
  
isBendSelected(bend:IBend):Boolean
Queries the selection state for the given bend.
GraphSelection
  
isEdgeSelected(edge:IEdge):Boolean
Queries the selection state for the given edge.
GraphSelection
  
isLabelSelected(label:ILabel):Boolean
Queries the selection state for the given label.
GraphSelection
  
isNodeSelected(node:INode):Boolean
Queries the selection state for the given node.
GraphSelection
  
isPortSelected(port:IPort):Boolean
Queries the selection state for the given port.
GraphSelection
  
isSelected(item:IModelItem):Boolean
Queries the selection state for the given item.
GraphSelection
  
Returns an Iterator over all selected items.
GraphSelection
  
setBendSelected(bend:IBend, selected:Boolean):void
Sets the selected state for the given bend.
GraphSelection
  
setEdgeSelected(edge:IEdge, selected:Boolean):void
Sets the selected state for the given edge.
GraphSelection
  
setLabelSelected(label:ILabel, selected:Boolean):void
Sets the selected state for the given label.
GraphSelection
  
setNodeSelected(node:INode, selected:Boolean):void
Sets the selected state for the given node.
GraphSelection
  
setPortSelected(port:IPort, selected:Boolean):void
Sets the selected state for the given port.
GraphSelection
  
setSelected(item:IModelItem, selected:Boolean):void
Sets the selected state for the given item.
GraphSelection
Protected Methods
 MethodDefined By
  
Factory method that creates the DefaultSelectionModel to use for the bends.
GraphSelection
  
Factory method that creates the DefaultSelectionModel to use for the edges.
GraphSelection
  
Factory method that creates the DefaultSelectionModel to use for the labels.
GraphSelection
  
Factory method that creates the DefaultSelectionModel to use for the nodes.
GraphSelection
  
Factory method that creates the DefaultSelectionModel to use for the ports.
GraphSelection
Property Detail
countproperty
count:uint  [read-only]

The number of all selected items.


Implementation
    public function get count():uint
graphproperty 
graph:IGraph

Gets or sets the IGraph this instance is using as the domain for the selection.


Implementation
    public function get graph():IGraph
    public function set graph(value:IGraph):void
selectedBendsproperty 
selectedBends:Iterable  [read-only]

Enumerates all currently selected bends.


Implementation
    public function get selectedBends():Iterable
selectedEdgesproperty 
selectedEdges:Iterable  [read-only]

Enumerates all currently selected edges.


Implementation
    public function get selectedEdges():Iterable
selectedLabelsproperty 
selectedLabels:Iterable  [read-only]

Enumerates all currently selected labels.


Implementation
    public function get selectedLabels():Iterable
selectedNodesproperty 
selectedNodes:Iterable  [read-only]

Enumerates all currently selected nodes.


Implementation
    public function get selectedNodes():Iterable
selectedObjectsproperty 
selectedObjects:Iterable  [read-only]

Gets an Iterable of all selected Objects.


Implementation
    public function get selectedObjects():Iterable
selectedPortsproperty 
selectedPorts:Iterable  [read-only]

Enumerates all currently selected ports.


Implementation
    public function get selectedPorts():Iterable
Constructor Detail
GraphSelection()Constructor
public function GraphSelection(graph:IGraph = null)

Instanciates an instance using the the graph as the model.

Parameters
graph:IGraph (default = null) — the graph instance to sync with. The graph property can also be set later.
Method Detail
clear()method
public function clear():void

Deselect all. Removes all items from the list of selected items.

createBendSelectionModel()method 
protected function createBendSelectionModel():DefaultSelectionModel

Factory method that creates the DefaultSelectionModel to use for the bends.

Returns
DefaultSelectionModel
createEdgeSelectionModel()method 
protected function createEdgeSelectionModel():DefaultSelectionModel

Factory method that creates the DefaultSelectionModel to use for the edges.

Returns
DefaultSelectionModel
createLabelSelectionModel()method 
protected function createLabelSelectionModel():DefaultSelectionModel

Factory method that creates the DefaultSelectionModel to use for the labels.

Returns
DefaultSelectionModel
createNodeSelectionModel()method 
protected function createNodeSelectionModel():DefaultSelectionModel

Factory method that creates the DefaultSelectionModel to use for the nodes.

Returns
DefaultSelectionModel
createPortSelectionModel()method 
protected function createPortSelectionModel():DefaultSelectionModel

Factory method that creates the DefaultSelectionModel to use for the ports.

Returns
DefaultSelectionModel
isBendSelected()method 
public function isBendSelected(bend:IBend):Boolean

Queries the selection state for the given bend.

Parameters

bend:IBend — the bend to query the state for

Returns
Boolean — whether the bend is currently selected
isEdgeSelected()method 
public function isEdgeSelected(edge:IEdge):Boolean

Queries the selection state for the given edge.

Parameters

edge:IEdge — the edge to query the state for

Returns
Boolean — whether the edge is currently selected
isLabelSelected()method 
public function isLabelSelected(label:ILabel):Boolean

Queries the selection state for the given label.

Parameters

label:ILabel — the label to query the state for

Returns
Boolean — whether the label is currently selected
isNodeSelected()method 
public function isNodeSelected(node:INode):Boolean

Queries the selection state for the given node.

Parameters

node:INode — the node to query the state for

Returns
Boolean — whether the node is currently selected
isPortSelected()method 
public function isPortSelected(port:IPort):Boolean

Queries the selection state for the given port.

Parameters

port:IPort — the port to query the state for

Returns
Boolean — whether the port is currently selected
isSelected()method 
public function isSelected(item:IModelItem):Boolean

Queries the selection state for the given item.

Parameters

item:IModelItem — the item to query the state for

Returns
Boolean — whether the item is currently selected
iterator()method 
public function iterator():Iterator

Returns an Iterator over all selected items.

Returns
Iterator — An Iterator over all selected items.
setBendSelected()method 
public function setBendSelected(bend:IBend, selected:Boolean):void

Sets the selected state for the given bend.

Parameters

bend:IBend — the bend to set the selection state for
 
selected:Boolean — the new selection state

setEdgeSelected()method 
public function setEdgeSelected(edge:IEdge, selected:Boolean):void

Sets the selected state for the given edge.

Parameters

edge:IEdge — the edge to set the selection state for
 
selected:Boolean — the new selection state

setLabelSelected()method 
public function setLabelSelected(label:ILabel, selected:Boolean):void

Sets the selected state for the given label.

Parameters

label:ILabel — the label to set the selection state for
 
selected:Boolean — the new selection state

setNodeSelected()method 
public function setNodeSelected(node:INode, selected:Boolean):void

Sets the selected state for the given node.

Parameters

node:INode — the node to set the selection state for
 
selected:Boolean — the new selection state

setPortSelected()method 
public function setPortSelected(port:IPort, selected:Boolean):void

Sets the selected state for the given port.

Parameters

port:IPort — the port to set the selection state for
 
selected:Boolean — the new selection state

setSelected()method 
public function setSelected(item:IModelItem, selected:Boolean):void

Sets the selected state for the given item.

Parameters

item:IModelItem — the item to set the selection state for
 
selected:Boolean — the new selection state