de.uni_paderborn.fujaba.fsa
Class SelectionManager

java.lang.Object
  extended byde.uni_paderborn.fujaba.fsa.SelectionManager
All Implemented Interfaces:
java.util.EventListener, de.upb.lib.userinterface.EventSource, SelectionListener

public class SelectionManager
extends java.lang.Object
implements de.upb.lib.userinterface.EventSource, SelectionListener

Version:
$Revision: 1.35 $
Author:
$Author: cschneid $

Method Summary
 void addToPopupSourceListeners(PopupSourceListener listener)
          Add a listener that receives a method call upon change of the logicPopupSource
 void addToSelectedComponents(javax.swing.JComponent component)
          Access method for an one to n association.
 void addToSelectedComponents(javax.swing.JComponent[] components)
          Access method for an one to n association.
 void addToSelection(ASGElement element)
          Add all fsaObjects belonging to an element to the selection.
 void addToSelection(FSAObject object)
          Access method for an one to n association.
 void addToSelection(FSAObject[] objects)
          Access method for an one to n association.
 void clear()
          No comment provided by developer, please add a comment to improve documentation.
static SelectionManager get()
          No comment provided by developer, please add a comment to improve documentation.
 java.lang.String getActionCommand()
          Handed over to the action as the command string for the event.
 javax.swing.JComponent getFocusedComponent()
          Get the focusedComponent attribute of the SelectionManager object
 FSAObject getFocusedObject()
          Get the focusedObject attribute of the SelectionManager object
 javax.swing.JComponent[] getLastSelectedComponents(javax.swing.JComponent obj, int length)
          This method returns the last 'index' selected items.
 javax.swing.JComponent[] getLastSelectedComponentsOfType(java.lang.Class typeClass, int length)
          Get the lastSelectedComponentsOfType attribute of the SelectionManager object
 javax.swing.JComponent[] getLastSelectedComponentsOfType(javax.swing.JComponent type, int length)
          Get the lastSelectedComponentsOfType attribute of the SelectionManager object
 FSAObject[] getLastSelections(FSAObject obj, int length)
          This method returns the last 'index' selected items.
 FSAObject[] getLastSelectionsOfType(java.lang.Class typeClass)
          Returns all selections of type 'typeClass'.
 FSAObject[] getLastSelectionsOfType(java.lang.Class typeClass, int length)
          Returns 'length' number of selected objects of type 'typeclass'.
 FSAObject[] getLastSelectionsOfType(FSAObject type, int length)
          This method returns the last 'index' selected items, which are instances of the class of the type object.
 LogicUnparseInterface getLogicPopupSource()
          Get the logicPopupSource attribute of the SelectionManager object
 java.awt.Component getPopupSource()
          Get the popupSource attribute of the SelectionManager object
 javax.swing.JComponent[] getSelectedComponents()
          Get the selectedComponents attribute of the SelectionManager object
 FSAObject[] getSelectedObjects()
          Get the selectedObjects attribute of the SelectionManager object
 java.lang.Object getSource()
          Returns an iterator of the objects from the environment of the source object.
 boolean hasInSelectedComponents(javax.swing.JComponent object)
          No comment provided by developer, please add a comment to improve documentation.
 boolean hasInSelection(FSAObject object)
          No comment provided by developer, please add a comment to improve documentation.
 boolean isFocused(javax.swing.JComponent component)
          Get the focused attribute of the SelectionManager object
 boolean isSelected(javax.swing.JComponent component)
          Get the selected attribute of the SelectionManager object
 java.util.Iterator iteratorOfSelectedComponents()
          No comment provided by developer, please add a comment to improve documentation.
 java.util.Iterator iteratorOfSelectedComponentsAsIncrements()
          No comment provided by developer, please add a comment to improve documentation.
 java.util.Iterator iteratorOfSelection()
          No comment provided by developer, please add a comment to improve documentation.
 java.util.Iterator iteratorOfSelectionAsIncrements()
          No comment provided by developer, please add a comment to improve documentation.
 javax.swing.JComponent nextComponent(javax.swing.JComponent object)
          No comment provided by developer, please add a comment to improve documentation.
 FSAObject nextObject(FSAObject object)
          No comment provided by developer, please add a comment to improve documentation.
 javax.swing.JComponent prevComponent(javax.swing.JComponent object)
          No comment provided by developer, please add a comment to improve documentation.
 FSAObject prevObject(FSAObject object)
          No comment provided by developer, please add a comment to improve documentation.
 void removeAllFromSelectedComponents()
          deselect all
 void removeFromPopupSourceListeners(PopupSourceListener listener)
          Remove a listener for logicPopupSource
 void removeFromSelectedComponents(javax.swing.JComponent object)
          No comment provided by developer, please add a comment to improve documentation.
 void removeFromSelectedComponents(javax.swing.JComponent[] objects)
          No comment provided by developer, please add a comment to improve documentation.
 void removeFromSelection(FSAObject object)
          No comment provided by developer, please add a comment to improve documentation.
 void removeFromSelection(FSAObject[] objects)
          No comment provided by developer, please add a comment to improve documentation.
 void replaceSelectedComponents(javax.swing.JComponent object)
          No comment provided by developer, please add a comment to improve documentation.
 void replaceSelectedComponents(javax.swing.JComponent[] objects)
          No comment provided by developer, please add a comment to improve documentation.
 void replaceSelection(FSAObject object)
          No comment provided by developer, please add a comment to improve documentation.
 void replaceSelection(FSAObject[] objects)
          No comment provided by developer, please add a comment to improve documentation.
 void selectionChanged(SelectionEvent event)
          No comment provided by developer, please add a comment to improve documentation.
 void setFocused(FSAObject object, boolean focus)
          set the component focused It is set as the focused Object and the previously focused Object is unfocused.
 void setFocused(javax.swing.JComponent component, boolean focus)
          set the component focused It is set as the focused Object and the previously focused Object is unfocused.
 void setFocusedComponent(javax.swing.JComponent component)
          Sets the focusedComponent attribute of the SelectionManager object
 void setFocusedObject(FSAObject object)
          Sets the focusedObject attribute of the SelectionManager object
 void setLogicPopupSource(LogicUnparseInterface logicSource)
          Sets the logicPopupSource attribute of the SelectionManager object
 void setPopupSource(java.awt.Component source)
          Sets the popupSource attribute of the SelectionManager object
 void setPopupSource(java.awt.Component source, LogicUnparseInterface logicSource)
          Sets the popupSource attribute of the SelectionManager object
 void setSelected(FSAObject object, boolean selected)
          Sets the selected attribute of the SelectionManager object
 void setSelected(FSAObject object, boolean selected, boolean multi)
          Sets the selected attribute of the SelectionManager object
 void setSelected(javax.swing.JComponent component, boolean selected)
          Sets the selected attribute of the SelectionManager object
 void setSelected(javax.swing.JComponent component, boolean selected, boolean multi)
          Sets the selected attribute of the SelectionManager object
 int sizeOfSelectedComponents()
          No comment provided by developer, please add a comment to improve documentation.
 int sizeOfSelection()
          No comment provided by developer, please add a comment to improve documentation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static SelectionManager get()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

setPopupSource

public void setPopupSource(java.awt.Component source,
                           LogicUnparseInterface logicSource)
Sets the popupSource attribute of the SelectionManager object

Parameters:
source - The new popupSource value
logicSource - The new popupSource value

setPopupSource

public void setPopupSource(java.awt.Component source)
Sets the popupSource attribute of the SelectionManager object

Parameters:
source - The new popupSource value

setLogicPopupSource

public void setLogicPopupSource(LogicUnparseInterface logicSource)
Sets the logicPopupSource attribute of the SelectionManager object

Parameters:
logicSource - The new logicPopupSource value

getLogicPopupSource

public LogicUnparseInterface getLogicPopupSource()
Get the logicPopupSource attribute of the SelectionManager object

Returns:
The logicPopupSource value

getPopupSource

public java.awt.Component getPopupSource()
Get the popupSource attribute of the SelectionManager object

Returns:
The popupSource value

getSource

public java.lang.Object getSource()
Returns an iterator of the objects from the environment of the source object. This could be a selection of multiple objects. Used for actions that manipulate more than one object. The first element is the element under popup if popup was called. Implements EventSource interface from UserInterfaceManager.

Specified by:
getSource in interface de.upb.lib.userinterface.EventSource
Returns:
The source value

getActionCommand

public java.lang.String getActionCommand()
Handed over to the action as the command string for the event. This string allows a "modal" component to specify one of several commands, depending on its state. For example, a single button might toggle between "show details" and "hide details". The source object and the event would be the same in each case, but the command string would identify the intended action. Implements EventSource interface from UserInterfaceManager.

Specified by:
getActionCommand in interface de.upb.lib.userinterface.EventSource
Returns:
The actionCommand value

setSelected

public void setSelected(javax.swing.JComponent component,
                        boolean selected)
Sets the selected attribute of the SelectionManager object

Parameters:
component - The new selected value
selected - The new selected value

setSelected

public void setSelected(javax.swing.JComponent component,
                        boolean selected,
                        boolean multi)
Sets the selected attribute of the SelectionManager object

Parameters:
component - The new selected value
selected - The new selected value
multi - The new selected value

isSelected

public boolean isSelected(javax.swing.JComponent component)
Get the selected attribute of the SelectionManager object

Parameters:
component - No description provided
Returns:
The selected value

setFocused

public void setFocused(javax.swing.JComponent component,
                       boolean focus)
set the component focused It is set as the focused Object and the previously focused Object is unfocused. If this Object is not yet selected, it is selected, too.

Parameters:
component - The new focused value
focus - The new focused value

isFocused

public boolean isFocused(javax.swing.JComponent component)
Get the focused attribute of the SelectionManager object

Parameters:
component - No description provided
Returns:
The focused value

setFocusedComponent

public void setFocusedComponent(javax.swing.JComponent component)
Sets the focusedComponent attribute of the SelectionManager object

Parameters:
component - The new focusedComponent value

getFocusedComponent

public javax.swing.JComponent getFocusedComponent()
Get the focusedComponent attribute of the SelectionManager object

Returns:
The focusedComponent value

addToSelectedComponents

public void addToSelectedComponents(javax.swing.JComponent component)
Access method for an one to n association.

Parameters:
component - The object added.

addToSelectedComponents

public void addToSelectedComponents(javax.swing.JComponent[] components)
Access method for an one to n association.

Parameters:
components - The object added.

iteratorOfSelectedComponents

public java.util.Iterator iteratorOfSelectedComponents()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

iteratorOfSelectedComponentsAsIncrements

public java.util.Iterator iteratorOfSelectedComponentsAsIncrements()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

hasInSelectedComponents

public boolean hasInSelectedComponents(javax.swing.JComponent object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided
Returns:
No description provided

sizeOfSelectedComponents

public int sizeOfSelectedComponents()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

replaceSelectedComponents

public void replaceSelectedComponents(javax.swing.JComponent object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided

replaceSelectedComponents

public void replaceSelectedComponents(javax.swing.JComponent[] objects)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
objects - No description provided

removeFromSelectedComponents

public void removeFromSelectedComponents(javax.swing.JComponent object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided

removeAllFromSelectedComponents

public void removeAllFromSelectedComponents()
deselect all


removeFromSelectedComponents

public void removeFromSelectedComponents(javax.swing.JComponent[] objects)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
objects - No description provided

prevComponent

public javax.swing.JComponent prevComponent(javax.swing.JComponent object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided
Returns:
No description provided

nextComponent

public javax.swing.JComponent nextComponent(javax.swing.JComponent object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided
Returns:
No description provided

getLastSelectedComponents

public javax.swing.JComponent[] getLastSelectedComponents(javax.swing.JComponent obj,
                                                          int length)
This method returns the last 'index' selected items.

Parameters:
length - number of the returned objects.
obj - If this object is not in the last 'length' selections, it will be returned as the last selected Object in the resulting array.
Returns:
An array consisting of the last 'length' selected objects.

getLastSelectedComponentsOfType

public javax.swing.JComponent[] getLastSelectedComponentsOfType(javax.swing.JComponent type,
                                                                int length)
Get the lastSelectedComponentsOfType attribute of the SelectionManager object

Parameters:
type - No description provided
length - No description provided
Returns:
The lastSelectedComponentsOfType value

getLastSelectedComponentsOfType

public javax.swing.JComponent[] getLastSelectedComponentsOfType(java.lang.Class typeClass,
                                                                int length)
Get the lastSelectedComponentsOfType attribute of the SelectionManager object

Parameters:
typeClass - No description provided
length - No description provided
Returns:
The lastSelectedComponentsOfType value

getSelectedComponents

public javax.swing.JComponent[] getSelectedComponents()
Get the selectedComponents attribute of the SelectionManager object

Returns:
The selectedComponents value

clear

public void clear()
No comment provided by developer, please add a comment to improve documentation.


setSelected

public void setSelected(FSAObject object,
                        boolean selected)
Sets the selected attribute of the SelectionManager object

Parameters:
object - The new selected value
selected - The new selected value

setSelected

public void setSelected(FSAObject object,
                        boolean selected,
                        boolean multi)
Sets the selected attribute of the SelectionManager object

Parameters:
object - The new selected value
selected - The new selected value
multi - The new selected value

setFocused

public void setFocused(FSAObject object,
                       boolean focus)
set the component focused It is set as the focused Object and the previously focused Object is unfocused. If this Object is not yet selected, it is selected, too.

Parameters:
object - The new focused value
focus - The new focused value

setFocusedObject

public void setFocusedObject(FSAObject object)
Sets the focusedObject attribute of the SelectionManager object

Parameters:
object - The new focusedObject value

getFocusedObject

public FSAObject getFocusedObject()
Get the focusedObject attribute of the SelectionManager object

Returns:
The focusedObject value

addToSelection

public void addToSelection(FSAObject object)
Access method for an one to n association.

Parameters:
object - The object added.

addToSelection

public void addToSelection(FSAObject[] objects)
Access method for an one to n association.

Parameters:
objects - The object added.

iteratorOfSelection

public java.util.Iterator iteratorOfSelection()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

iteratorOfSelectionAsIncrements

public java.util.Iterator iteratorOfSelectionAsIncrements()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

hasInSelection

public boolean hasInSelection(FSAObject object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided
Returns:
No description provided

sizeOfSelection

public int sizeOfSelection()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

replaceSelection

public void replaceSelection(FSAObject object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided

replaceSelection

public void replaceSelection(FSAObject[] objects)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
objects - No description provided

removeFromSelection

public void removeFromSelection(FSAObject object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided

removeFromSelection

public void removeFromSelection(FSAObject[] objects)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
objects - No description provided

prevObject

public FSAObject prevObject(FSAObject object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided
Returns:
No description provided

nextObject

public FSAObject nextObject(FSAObject object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided
Returns:
No description provided

getLastSelections

public FSAObject[] getLastSelections(FSAObject obj,
                                     int length)
This method returns the last 'index' selected items.

Parameters:
length - number of the returned objects.
obj - If this object is not in the last 'length' selections, it will be returned as the last selected Object in the resulting array.
Returns:
An array consisting of the last 'length' selected objects.

getLastSelectionsOfType

public FSAObject[] getLastSelectionsOfType(FSAObject type,
                                           int length)
This method returns the last 'index' selected items, which are instances of the class of the type object.

Parameters:
length - number of the returned objects.
type - Only objects of this type are returned.
Returns:
An array consisting of the last 'length' selected objects.

getLastSelectionsOfType

public FSAObject[] getLastSelectionsOfType(java.lang.Class typeClass)
Returns all selections of type 'typeClass'.

Parameters:
typeClass - No description provided
Returns:
The lastSelectionsOfType value

getLastSelectionsOfType

public FSAObject[] getLastSelectionsOfType(java.lang.Class typeClass,
                                           int length)
Returns 'length' number of selected objects of type 'typeclass'.

Parameters:
typeClass - No description provided
length - No description provided
Returns:
The lastSelectionsOfType value

getSelectedObjects

public FSAObject[] getSelectedObjects()
Get the selectedObjects attribute of the SelectionManager object

Returns:
The selectedObjects value

selectionChanged

public void selectionChanged(SelectionEvent event)
No comment provided by developer, please add a comment to improve documentation.

Specified by:
selectionChanged in interface SelectionListener
Parameters:
event - No description provided

addToPopupSourceListeners

public void addToPopupSourceListeners(PopupSourceListener listener)
Add a listener that receives a method call upon change of the logicPopupSource

Parameters:
listener - to be added

removeFromPopupSourceListeners

public void removeFromPopupSourceListeners(PopupSourceListener listener)
Remove a listener for logicPopupSource

Parameters:
listener - to be removed

addToSelection

public void addToSelection(ASGElement element)
Add all fsaObjects belonging to an element to the selection.

Parameters:
element - which element to be selected