com.swfm.mica.core
Class MiSelectionManager

java.lang.Object
  extended bycom.swfm.mica.core.MiSelectionManager
All Implemented Interfaces:
MiiActionTypes, MiiSelectionManager

public class MiSelectionManager
extends java.lang.Object
implements MiiSelectionManager, MiiActionTypes

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
   
Constructor Summary
MiSelectionManager(MiEditor editor)
          Contructs a new MiSelectionManager.
 
Method Summary
 boolean deSelectAll()
          Deselects all the items in the editor.
 void deSelectObject(MiPart obj)
          Deselects the given item.
 boolean getKeepOneSelectedAtAllTimes()
          Gets whether to assure that AT LEAST one item is selected.
 boolean getManyCanBeSelectedAtOneTime()
          Gets whether to assure that AT MOST one item is selected.
 MiiSelectionGraphics getSelectionGraphics()
          Gets the class that will handle the change in appearance of selected items.
static void notifyAboutNumberOfShapesSelected(MiEditor editor)
          Calculates and then dispatches the appropriate action indicating how many items are selected in the given editor.
 boolean select(MiParts parts)
          Selects all the items in the given list.
 void selectAdditionalObject(MiPart obj)
          Selects the given item.
 boolean selectAll()
          Selects all the items in the editor.
 void selectObject(MiPart obj)
          Selects the given item.
 void setKeepOneSelectedAtAllTimes(boolean flag)
          Sets whether to assure that AT LEAST one item is always selected by preventing the deselection of an item if it is the only selected item.
 void setManyCanBeSelectedAtOneTime(boolean flag)
          Sets whether to assure that AT MOST one item is selected at any one time by deselecting the currently selected item if a new item is being selected.
 void setSelectionGraphics(MiiSelectionGraphics graphics)
          Sets the class that will handle the change in appearance of selected items.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiSelectionManager

public MiSelectionManager(MiEditor editor)
Contructs a new MiSelectionManager.

Method Detail

setKeepOneSelectedAtAllTimes

public void setKeepOneSelectedAtAllTimes(boolean flag)
Sets whether to assure that AT LEAST one item is always selected by preventing the deselection of an item if it is the only selected item. It does NOT select an item if none are currently selected.

Parameters:
flag - true if one item is always selected

getKeepOneSelectedAtAllTimes

public boolean getKeepOneSelectedAtAllTimes()
Gets whether to assure that AT LEAST one item is selected.


setManyCanBeSelectedAtOneTime

public void setManyCanBeSelectedAtOneTime(boolean flag)
Sets whether to assure that AT MOST one item is selected at any one time by deselecting the currently selected item if a new item is being selected. This can be temporarily avoided by using the selectAdditionalObject method.

Parameters:
flag - true if at most one item is to be selected

getManyCanBeSelectedAtOneTime

public boolean getManyCanBeSelectedAtOneTime()
Gets whether to assure that AT MOST one item is selected.


setSelectionGraphics

public void setSelectionGraphics(MiiSelectionGraphics graphics)
Sets the class that will handle the change in appearance of selected items.

Specified by:
setSelectionGraphics in interface MiiSelectionManager
Parameters:
graphics - the class that will decide how to display selected items

getSelectionGraphics

public MiiSelectionGraphics getSelectionGraphics()
Gets the class that will handle the change in appearance of selected items.

Specified by:
getSelectionGraphics in interface MiiSelectionManager
Returns:
the class that will decide how to display selected items

selectAll

public boolean selectAll()
Selects all the items in the editor.

Specified by:
selectAll in interface MiiSelectionManager
Returns:
true if something new was selected

deSelectAll

public boolean deSelectAll()
Deselects all the items in the editor.

Specified by:
deSelectAll in interface MiiSelectionManager
Returns:
true if something was deselected

selectObject

public void selectObject(MiPart obj)
Selects the given item.

Specified by:
selectObject in interface MiiSelectionManager
Parameters:
obj - the item to select

selectAdditionalObject

public void selectAdditionalObject(MiPart obj)
Selects the given item. No other items are deselected.

Specified by:
selectAdditionalObject in interface MiiSelectionManager
Parameters:
obj - the item to select

deSelectObject

public void deSelectObject(MiPart obj)
Deselects the given item.

Specified by:
deSelectObject in interface MiiSelectionManager
Parameters:
obj - the item to deselect

select

public boolean select(MiParts parts)
Selects all the items in the given list.

Specified by:
select in interface MiiSelectionManager
Parameters:
parts - the items to select
Returns:
true if something new was selected

notifyAboutNumberOfShapesSelected

public static void notifyAboutNumberOfShapesSelected(MiEditor editor)
Calculates and then dispatches the appropriate action indicating how many items are selected in the given editor.

Parameters:
editor - the editor