uk.ac.cisban.rod.data
Class ExperimentManager

java.lang.Object
  extended by uk.ac.cisban.rod.data.AbstractDataTypeManager
      extended by uk.ac.cisban.rod.data.ExperimentManager

public class ExperimentManager
extends AbstractDataTypeManager

Manages Experiments and their Repeats.

Author:
Morgan Taschuk

Field Summary
 
Fields inherited from class uk.ac.cisban.rod.data.AbstractDataTypeManager
currentTasks, listeners
 
Constructor Summary
ExperimentManager()
          Main constructor.
 
Method Summary
 javax.swing.SwingWorker exportExperiment(java.io.File afile)
          Returns a StateSwingWorker that can export the currently loaded experiment to file.
 javax.swing.SwingWorker exportExperiment(java.io.File afile, Experiment exp)
          Returns a StateSwingWorker that can export the given experiment to file.
 Experiment getCurrentExperiment()
          Gets the current experiment.
 Repeat getCurrentRepeat()
           
 java.util.Collection<Experiment> getExperiments()
          Retrieves all experiments from the database.
 java.util.Collection<ProtocolCV> getProtocols()
          Retrieves all protocols from the database.
 java.util.Collection<Repeat> getRepeats()
          gets the collection of repeats
 javax.swing.SwingWorker loadExperiment(Experiment experiment)
          Returns a StateSwingWorker that can load an experiment based on an Experiment.
 javax.swing.SwingWorker loadExperiment(Experiment experiment, Repeat repeat)
          Returns a StateSwingWorker that can load the given Experiment and Repeat.
 javax.swing.SwingWorker modifyExperiment(Experiment experiment)
          Returns a StateSwingWorker that can modify the details of an existing experiment.
 javax.swing.SwingWorker newExperiment(Experiment experiment)
          Returns a StateSwingWorker that can load an experiment based on a Experiment.
 void setCurrentRepeat(Repeat currentRepeat)
          changes the instance of the current repeat to a new Repeat
 void setRepeat(Repeat rep)
          Sets the currently displayed repeat.
 
Methods inherited from class uk.ac.cisban.rod.data.AbstractDataTypeManager
addChangeListener, cancelCurrentTasks, hasCurrentTask, hasCurrentTask, isLoaded, removeChangeListener, setLoaded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExperimentManager

public ExperimentManager()
Main constructor.

Method Detail

loadExperiment

public javax.swing.SwingWorker loadExperiment(Experiment experiment)
Returns a StateSwingWorker that can load an experiment based on an Experiment. Checks to see whether the Experiment exists in the database, based upon the ID. If it does, it retrieves it. If it doesn't, it creates it. The StateSwingWorker must be executed to load the experiment.

Parameters:
experiment - the Experiment object containing the experimental information
Returns:
a thread that will load the experiment upon execution

loadExperiment

public javax.swing.SwingWorker loadExperiment(Experiment experiment,
                                              Repeat repeat)
Returns a StateSwingWorker that can load the given Experiment and Repeat. The StateSwingWorker must be executed to load the experiment.

Parameters:
experiment -
repeat -
Returns:

newExperiment

public javax.swing.SwingWorker newExperiment(Experiment experiment)
Returns a StateSwingWorker that can load an experiment based on a Experiment. Checks to see whether the Experiment exists in the database, based upon the ID. If it does, it retrieves it. If it doesn't, it creates it. The StateSwingWorker must be executed to create the experiment.

Parameters:
experiment - the Experiment object containing the experimental information
Returns:
a thread that will load the experiment upon execution

setRepeat

public void setRepeat(Repeat rep)
Sets the currently displayed repeat.

Parameters:
rep -

modifyExperiment

public javax.swing.SwingWorker modifyExperiment(Experiment experiment)
Returns a StateSwingWorker that can modify the details of an existing experiment. The StateSwingWorker must be executed to modify the experiment.

Parameters:
experiment - experiment to be modified
Returns:
thread to modify experiment

getCurrentExperiment

public Experiment getCurrentExperiment()
Gets the current experiment.

Returns:
the Experiment instance of the current experiment, null if none

getRepeats

public java.util.Collection<Repeat> getRepeats()
gets the collection of repeats

Returns:

getCurrentRepeat

public Repeat getCurrentRepeat()
Returns:

setCurrentRepeat

public void setCurrentRepeat(Repeat currentRepeat)
changes the instance of the current repeat to a new Repeat

Parameters:
currentRepeat - repeat to be set.

exportExperiment

public javax.swing.SwingWorker exportExperiment(java.io.File afile)
Returns a StateSwingWorker that can export the currently loaded experiment to file. The StateSwingWorker must be executed to export the experiment.

Parameters:
afile -
Returns:
a thread that will export the experiment to file upon execution.

exportExperiment

public javax.swing.SwingWorker exportExperiment(java.io.File afile,
                                                Experiment exp)
Returns a StateSwingWorker that can export the given experiment to file. The StateSwingWorker must be executed to export the experiment.

Parameters:
afile -
exp -
Returns:

getExperiments

public java.util.Collection<Experiment> getExperiments()
                                                throws QueryNotFoundException
Retrieves all experiments from the database.

Returns:
collection of experiments.
Throws:
QueryNotFoundException

getProtocols

public java.util.Collection<ProtocolCV> getProtocols()
                                              throws QueryNotFoundException
Retrieves all protocols from the database.

Returns:
collection of protocols.
Throws:
QueryNotFoundException


Copyright © 2010. All Rights Reserved.