Packagecom.yworks.graph.model
Classpublic class DefaultSelectionModel
InheritanceDefaultSelectionModel Inheritance flash.events.EventDispatcher
Implements ISelectionModel

Default implementation of an ISelectionModel that is based on a second collection model to hold the selected elements.



Public Properties
 PropertyDefined By
  count : uint
[read-only] Returns the number of selected items.
DefaultSelectionModel
  domain : ICollectionModel
Gets or sets the domain of the selection model.
DefaultSelectionModel
  selectedObjects : Iterable
[read-only] Gets an iterable that enumerates all currently selected items.
DefaultSelectionModel
  selection : ICollectionModel
[read-only] Provides a collection model view over the selected items.
DefaultSelectionModel
Public Methods
 MethodDefined By
  
Creates a default selection model implementation that uses a DefaultCollectionModel to hold the selection.
DefaultSelectionModel
  
clear():void
Clears the selection.
DefaultSelectionModel
  
isSelected(item:IModelItem):Boolean
Determines whether an item is currently selected.
DefaultSelectionModel
  
Returns an Iterator over the selected items.
DefaultSelectionModel
  
setSelected(item:IModelItem, selected:Boolean):void
Sets the selection state of an item.
DefaultSelectionModel
Protected Methods
 MethodDefined By
  
Called when an item gets deselected.
DefaultSelectionModel
  
Called when an item gets selected.
DefaultSelectionModel
Events
 Event Summary Defined By
  Dispatched when an item has been deselectedDefaultSelectionModel
  Dispatched when an item has been selectedDefaultSelectionModel
Property Detail
countproperty
count:uint  [read-only]

Returns the number of selected items.


Implementation
    public function get count():uint
domainproperty 
domain:ICollectionModel

Gets or sets the domain of the selection model.

The domain describes items that can possibly be selected. This implementation automatically deselects items that get removed from the domain.


Implementation
    public function get domain():ICollectionModel
    public function set domain(value:ICollectionModel):void
selectedObjectsproperty 
selectedObjects:Iterable  [read-only]

Gets an iterable that enumerates all currently selected items.


Implementation
    public function get selectedObjects():Iterable
selectionproperty 
selection:ICollectionModel  [read-only]

Provides a collection model view over the selected items.


Implementation
    public function get selection():ICollectionModel
Constructor Detail
DefaultSelectionModel()Constructor
public function DefaultSelectionModel()

Creates a default selection model implementation that uses a DefaultCollectionModel to hold the selection.

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.
iterator()method 
public function iterator():Iterator

Returns an Iterator over the selected items.

Returns
Iterator — An Iterator over the selected items.
onItemDeselected()method 
protected function onItemDeselected(item:IModelItem):void

Called when an item gets deselected.

Parameters

item:IModelItem

onItemSelected()method 
protected function onItemSelected(item:IModelItem):void

Called when an item gets selected.

Parameters

item:IModelItem

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 has been deselected

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

Dispatched when an item has been selected