edu.umd.cfar.lamp.viper.util
Class ViperSelectionSetWithPrimarySelection

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.util.AbstractViperSelection
      extended byedu.umd.cfar.lamp.viper.util.ViperSelectionSet
          extended byedu.umd.cfar.lamp.viper.util.ViperSelectionSetWithPrimarySelection
All Implemented Interfaces:
ViperSelection

public class ViperSelectionSetWithPrimarySelection
extends ViperSelectionSet

An extension to the 'set' type of selection to include information about which node in the viper tree was the last one to be added to the set.


Field Summary
 
Fields inherited from class edu.umd.cfar.lamp.viper.util.AbstractViperSelection
notifyingListeners
 
Constructor Summary
ViperSelectionSetWithPrimarySelection()
          Creates an empty selection set with the primary selection empty, as well.
 
Method Summary
 void addNode(Node n)
          Adds a new node to the set of selected nodes.
 void clear()
          Removes any selection.
 DefaultSingleViperSubTree getPrimary()
          Gets the primary selection.
 void removeNode(Node n)
          Removes the given node from the set of selected nodes.
 void setRoot(ViperData root)
           
 void setTo(Node node)
          Sets to the single element selection 'node'
 void setTo(java.util.Set set)
          Replaces the current set of selections with the given set.
 
Methods inherited from class edu.umd.cfar.lamp.viper.util.ViperSelectionSet
getRoot, getSelectionBeneath, isEmpty, isSelected
 
Methods inherited from class edu.umd.cfar.lamp.viper.util.AbstractViperSelection
addChangeListener, fireChangeEvent, getChangeListeners, removeChangeListener, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViperSelectionSetWithPrimarySelection

public ViperSelectionSetWithPrimarySelection()
Creates an empty selection set with the primary selection empty, as well.

Method Detail

setRoot

public void setRoot(ViperData root)
Overrides:
setRoot in class ViperSelectionSet
Parameters:
root -

setTo

public void setTo(Node node)
Description copied from class: ViperSelectionSet
Sets to the single element selection 'node'

Overrides:
setTo in class ViperSelectionSet
Parameters:
node - the node to select

getPrimary

public DefaultSingleViperSubTree getPrimary()
Gets the primary selection.

Returns:

setTo

public void setTo(java.util.Set set)
Description copied from class: ViperSelectionSet
Replaces the current set of selections with the given set.

Overrides:
setTo in class ViperSelectionSet
Parameters:
set -

addNode

public void addNode(Node n)
Description copied from class: ViperSelectionSet
Adds a new node to the set of selected nodes.

Overrides:
addNode in class ViperSelectionSet
Parameters:
n -

clear

public void clear()
Description copied from class: ViperSelectionSet
Removes any selection.

Overrides:
clear in class ViperSelectionSet

removeNode

public void removeNode(Node n)
Description copied from class: ViperSelectionSet
Removes the given node from the set of selected nodes.

Overrides:
removeNode in class ViperSelectionSet
Parameters:
n - the node to remove