util
Class SelectionManager

java.lang.Object
  extended by util.SelectionManager

public class SelectionManager
extends java.lang.Object

This manager class handles the selections made by the user.


Field Summary
static int NO_SELECTION
          Constant for marking no selection.
 
Constructor Summary
SelectionManager()
           
 
Method Summary
static void addSequenceByPosition(int position)
           
static void addToCurrentSelection(int newSelection)
          Adds an element to the current selection.
static boolean contains(int newSelection)
          Checks if an element is selected
static void emptyCurrentSelection()
          Delete all elements from the current selection.
static java.util.Vector<java.lang.Integer> getCurrentSelection()
           
static java.util.Vector<java.lang.Integer> getFullSelection()
          Creates a combination vector of positions from SelectionManager and ResidueSelectionManager
static int getLastSelection()
           
static S3DetObject getS3detobj()
           
static SequencePainter getSeqPainter()
           
static boolean isEmpty()
          Checks if the selection is empty
static boolean isEnabled()
           
static boolean isUpperSelectionOn()
           
static void setCurrentSelection(java.util.Vector<java.lang.Integer> currentSelection)
           
static void setEnabled(boolean enabled)
           
static void setLastSelection(int lastSelection, boolean centerSelection)
           
static void setS3detobj(S3DetObject s3detobj)
           
static void setSeqPainter(SequencePainter seqPainter)
           
static void setUpperSelectionOn(boolean upperSelectionOn)
           
static void toggleSelection(int newSelection, boolean centerSelection)
          Adds an element to the current selection.
static void updateSeqPainter()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_SELECTION

public static final int NO_SELECTION
Constant for marking no selection.

See Also:
Constant Field Values
Constructor Detail

SelectionManager

public SelectionManager()
Method Detail

isEnabled

public static boolean isEnabled()

setEnabled

public static void setEnabled(boolean enabled)

getCurrentSelection

public static java.util.Vector<java.lang.Integer> getCurrentSelection()

setCurrentSelection

public static void setCurrentSelection(java.util.Vector<java.lang.Integer> currentSelection)

addToCurrentSelection

public static void addToCurrentSelection(int newSelection)
Adds an element to the current selection.

Parameters:
Integer - newSelection

toggleSelection

public static void toggleSelection(int newSelection,
                                   boolean centerSelection)
Adds an element to the current selection.

Parameters:
Integer - newSelection

emptyCurrentSelection

public static void emptyCurrentSelection()
Delete all elements from the current selection.


isUpperSelectionOn

public static boolean isUpperSelectionOn()

setUpperSelectionOn

public static void setUpperSelectionOn(boolean upperSelectionOn)

getSeqPainter

public static SequencePainter getSeqPainter()
Returns:
the seqPainter

setSeqPainter

public static void setSeqPainter(SequencePainter seqPainter)
Parameters:
seqPainter - the seqPainter to set

updateSeqPainter

public static void updateSeqPainter()
Parameters:
seqPainter - the seqPainter to set

getS3detobj

public static S3DetObject getS3detobj()
Returns:
the s3detobj

setS3detobj

public static void setS3detobj(S3DetObject s3detobj)
Parameters:
s3detobj - the s3detobj to set

addSequenceByPosition

public static void addSequenceByPosition(int position)
Parameters:
position - the position of the sequencein s3detobj

contains

public static boolean contains(int newSelection)
Checks if an element is selected

Parameters:
newSelection - element to find
Returns:
true if the index element is selected, false if not

isEmpty

public static boolean isEmpty()
Checks if the selection is empty

Returns:
true if the selection is empty, false if not

getFullSelection

public static java.util.Vector<java.lang.Integer> getFullSelection()
Creates a combination vector of positions from SelectionManager and ResidueSelectionManager

Returns:
The result vector of combination

getLastSelection

public static int getLastSelection()
Returns:
the lastSelection

setLastSelection

public static void setLastSelection(int lastSelection,
                                    boolean centerSelection)
Parameters:
lastSelection - the lastSelection to set