org.graffiti.plugins.scripting.delegates
Class SelectionDelegate

java.lang.Object
  extended by org.graffiti.plugins.scripting.delegate.ScriptingDelegate
      extended by org.graffiti.plugins.scripting.delegate.ReflectiveDelegate
          extended by org.graffiti.plugins.scripting.delegate.ObjectDelegate
              extended by org.graffiti.plugins.scripting.delegates.CollectionDelegate
                  extended by org.graffiti.plugins.scripting.delegates.SelectionDelegate
All Implemented Interfaces:
org.graffiti.plugins.scripting.delegate.Unwrappable<Collection<GraphElement>>

public class SelectionDelegate
extends CollectionDelegate
implements org.graffiti.plugins.scripting.delegate.Unwrappable<Collection<GraphElement>>

Delegate, which represents the current selection of a session. As the Selection and SelectionModel objects of a session may change, but every instance of SelectionDelegate always refers to the current selection, they are obtained from the session each time they are needed.

Author:
Andreas Gleißner
See Also:
EditorSession.getSelectionModel()

Field Summary
 
Fields inherited from class org.graffiti.plugins.scripting.delegate.ScriptingDelegate
UNDEFINED
 
Constructor Summary
SelectionDelegate(org.graffiti.plugins.scripting.Scope scope, EditorSession session)
          Constructs a SelectionDelegate in the specified scope for the specified session.
 
Method Summary
 void clear()
          Clears this collection.
 boolean isEmpty()
          Returns if this collection delegate contains no GraphElementDelegates.
 int size()
           
 Collection<GraphElement> unwrap()
           
 
Methods inherited from class org.graffiti.plugins.scripting.delegates.CollectionDelegate
add, add, clone, contains, contains, count, get, getEdges, getIndices, getNodes, has, iterator, remove, remove, set, set, toString
 
Methods inherited from class org.graffiti.plugins.scripting.delegate.ObjectDelegate
createConstructor, createWrapper, get, getMemberInfo, getScope, has, put
 
Methods inherited from class org.graffiti.plugins.scripting.delegate.ReflectiveDelegate
addDynamicMemberInfo, delete, delete, getClassName, help, put
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectionDelegate

public SelectionDelegate(org.graffiti.plugins.scripting.Scope scope,
                         EditorSession session)
Constructs a SelectionDelegate in the specified scope for the specified session.

Parameters:
scope - the scope.
session - the session the current selection of which to represent.
Method Detail

clear

public void clear()
Description copied from class: CollectionDelegate
Clears this collection.

Specified by:
clear in class CollectionDelegate

isEmpty

public boolean isEmpty()
Description copied from class: CollectionDelegate
Returns if this collection delegate contains no GraphElementDelegates.

Specified by:
isEmpty in class CollectionDelegate
Returns:
true if this collection delegate contains no GraphElementDelegates.

size

public int size()
Specified by:
size in class CollectionDelegate

unwrap

public Collection<GraphElement> unwrap()
Specified by:
unwrap in interface org.graffiti.plugins.scripting.delegate.Unwrappable<Collection<GraphElement>>


Generated at 2012-05-30 11:01:25 PM CEST