gishur.gui2.handler
Class SelectElementContextActor

java.lang.Object
  |
  +--gishur.gui2.handler.SelectElementContextActor
All Implemented Interfaces:
ContextActor

public class SelectElementContextActor
extends java.lang.Object
implements ContextActor

Version:
1.0
Author:
Thomas Wolf

Field Summary
static java.lang.String CLEARSELECT_COMMAND
           
static byte DOUBLE_SELECT_UNSELECTS
           
static byte NORMAL
           
static java.lang.String SELECT_COMMAND
           
static byte SELECT_ONLY_ONE
           
static java.lang.String UNSELECT_COMMAND
           
 
Constructor Summary
SelectElementContextActor()
          Constructs a new SelectElementContextActor.
SelectElementContextActor(int mode)
          Constructs a new SelectElementContextActor with the given mode (a combination of {NORMAL,SELECT_ONLY_ONE, DOUBLE_SELECT_UNSELECTS}).
 
Method Summary
 void doMenuAction(java.lang.String cmd, DrawAtom context, java.lang.String context_element)
          Does the action of a special context menu.
 void select(DisplayInteractiveObject dob)
          Selects the given DisplayInteractiveObject and adds it to the list of selected elements.
 ListView selected()
          Returns a ListView with all selected elements.
 DisplayInteractiveObject selectedFirst()
          Returns the first element of the selected elements.
 void unselect(DisplayInteractiveObject dob)
          Unselects the given DisplayInteractiveObject and removes it from the list of selected elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL

public static final byte NORMAL

SELECT_ONLY_ONE

public static final byte SELECT_ONLY_ONE

DOUBLE_SELECT_UNSELECTS

public static final byte DOUBLE_SELECT_UNSELECTS

SELECT_COMMAND

public static final java.lang.String SELECT_COMMAND

UNSELECT_COMMAND

public static final java.lang.String UNSELECT_COMMAND

CLEARSELECT_COMMAND

public static final java.lang.String CLEARSELECT_COMMAND
Constructor Detail

SelectElementContextActor

public SelectElementContextActor(int mode)
Constructs a new SelectElementContextActor with the given mode (a combination of {NORMAL,SELECT_ONLY_ONE, DOUBLE_SELECT_UNSELECTS}).

SelectElementContextActor

public SelectElementContextActor()
Constructs a new SelectElementContextActor.
Method Detail

selected

public ListView selected()
Returns a ListView with all selected elements.
Returns:
a ListView with all selected elements.

selectedFirst

public DisplayInteractiveObject selectedFirst()
Returns the first element of the selected elements.
Returns:
the first element of the selected elements.

select

public void select(DisplayInteractiveObject dob)
Selects the given DisplayInteractiveObject and adds it to the list of selected elements.
Parameters:
dob - the DisplayInteractiveObject to select

unselect

public void unselect(DisplayInteractiveObject dob)
Unselects the given DisplayInteractiveObject and removes it from the list of selected elements.
Parameters:
dob - the DisplayInteractiveObject to unselect

doMenuAction

public void doMenuAction(java.lang.String cmd,
                         DrawAtom context,
                         java.lang.String context_element)
Does the action of a special context menu.
Specified by:
doMenuAction in interface ContextActor
Parameters:
cmd - the command string of the MenuItem selected
context - the DrawAtom that is the context
context_element - the actual context element name of the given context DrawAtom.