Packagecom.yworks.graph.model
Interfacepublic interface ISelectionModel extends flash.events.IEventDispatcher, Iterable
Implementors DefaultSelectionModel

An interface that models the selection state of a set of items.



Public Properties
 PropertyDefined By
  count : uint
[read-only] Returns the number of selected items.
ISelectionModel
  selectedObjects : Iterable
[read-only] Gets an iterable that enumerates all currently selected items.
ISelectionModel
Public Methods
 MethodDefined By
  
clear():void
Clears the selection.
ISelectionModel
  
isSelected(item:IModelItem):Boolean
Determines whether an item is currently selected.
ISelectionModel
 Inherited
Returns an iterator over a set of elements.
Iterable
  
setSelected(item:IModelItem, selected:Boolean):void
Sets the selection state of an item.
ISelectionModel
Events
 Event Summary Defined By
  Dispatched when an item changed its selection state from selected to unselected.ISelectionModel
  Dispatched when an item changed its selection state from unselected to selected.ISelectionModel
Property Detail
countproperty
count:uint  [read-only]

Returns the number of selected items.


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

Gets an iterable that enumerates all currently selected items.


Implementation
    public function get selectedObjects():Iterable
Method Detail
clear()method
public function clear():void

Clears the selection.

isSelected()method 
public function isSelected(item:IModelItem):Boolean

Determines whether an item is currently selected.

Parameters

item:IModelItem — The item to check.

Returns
Boolean — Whether the item is currently selected.
setSelected()method 
public function setSelected(item:IModelItem, selected:Boolean):void

Sets the selection state of an item.

Parameters

item:IModelItem — The object to set the selection state for.
 
selected:Boolean — Whether to select the object.

Event Detail
deselect Event
Event Object Type: com.yworks.graph.model.SelectionEvent
SelectionEvent.type property = com.yworks.graph.model.SelectionEvent.DESELECT

Dispatched when an item changed its selection state from selected to unselected.

select Event  
Event Object Type: com.yworks.graph.model.SelectionEvent
SelectionEvent.type property = com.yworks.graph.model.SelectionEvent.SELECT

Dispatched when an item changed its selection state from unselected to selected.