uk.ac.cisban.rod.data
Class PlateManager

java.lang.Object
  extended by uk.ac.cisban.rod.data.PlateManager

public class PlateManager
extends java.lang.Object

Manages the parsing and saving of everything to do with Plates, including MasterplateSets, PlateCVs, MediumCVs, BackgroundMutationCVs, TreatmentCVs, etc.

Since:
2-Dec-2008 4:50:50 PM
Author:
Morgan

Field Summary
protected  java.util.List<javax.swing.SwingWorker> currentTasks
           
 
Constructor Summary
PlateManager()
           
 
Method Summary
 javax.swing.SwingWorker addTreatmentsToPlates(java.lang.String plates, TreatmentCV treatment, java.util.Date date)
          Returns a thread that will add the TreatmentCV to the plates in the String.
 void cancelCurrentTasks()
          cancels all queued tasks for a swingworker.
 java.util.Map<java.lang.String,java.lang.Exception> createMasterplateSet(java.util.List<java.lang.String> barcodes, java.util.Map<java.lang.Integer,java.util.Set<MasterplatePosition>> numToPos, java.lang.String description, MasterplateLibraryCV mpcv, BackgroundMutationCV bmcv, DatabaseProgressListener listener, PlateCV pcv)
           
 java.util.Collection<BackgroundMutationCV> getBackgroundMutationCVs()
          creates a link to the database and retrieves all backgroundMutationCVs.
 java.util.Collection<MasterplateLibraryCV> getMasterplateLibraryCVs()
          creates a link to the database and retrieves all MasterplatelibraryCVs.
 java.util.Collection<MasterplateSet> getMasterplateSets()
          creates a link to the database and retrieves all masterplates sets.
 java.util.Collection<MediumCV> getMediumCVs()
          creates a link to the database and retrieves all mediumCVs.
 java.util.Collection<PlateCV> getPlateCVs()
          creates a link to the database and retrieves all plateCVs.
 java.util.Collection<Plate> getPlates()
          creates a link to the database and retrieves all plates.
 java.util.Collection<TreatmentCV> getTreatmentCVs()
          creates a link to the database and retrieves all treatments.
 boolean hasCurrentTask()
          checks if there are 1 or more current tasks queued by a swingworker.
 javax.swing.SwingWorker loadMasterPlate(MasterplateLibraryCV mpcv, java.lang.String description, java.util.List<java.lang.String> barcodes, java.io.File file, BackgroundMutationCV bmcv, PlateCV pcv)
          Returns a thread that will load a new masterplate.
 javax.swing.SwingWorker modifyMedium(MediumCV medium)
           
 javax.swing.SwingWorker modifyTreatment(TreatmentCV treatment)
           
 javax.swing.SwingWorker newMedium(MediumCV medium)
          Returns a thread that will add a new medium.
 javax.swing.SwingWorker newMutation(BackgroundMutationCV mutationCV)
          Returns a thread that will create a new mutation.
 javax.swing.SwingWorker newTreatment(TreatmentCV treatment)
          Returns a thread that will create a new treatment.
 javax.swing.SwingWorker pourPlates(MediumCV mediumCV, java.util.List<java.lang.String> barcodes, java.util.Date datePoured, PlateCV plateCV)
          Returns a thread that will pour the plates in the String in the medium specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentTasks

protected java.util.List<javax.swing.SwingWorker> currentTasks
Constructor Detail

PlateManager

public PlateManager()
Method Detail

createMasterplateSet

public java.util.Map<java.lang.String,java.lang.Exception> createMasterplateSet(java.util.List<java.lang.String> barcodes,
                                                                                java.util.Map<java.lang.Integer,java.util.Set<MasterplatePosition>> numToPos,
                                                                                java.lang.String description,
                                                                                MasterplateLibraryCV mpcv,
                                                                                BackgroundMutationCV bmcv,
                                                                                DatabaseProgressListener listener,
                                                                                PlateCV pcv)

modifyMedium

public javax.swing.SwingWorker modifyMedium(MediumCV medium)

modifyTreatment

public javax.swing.SwingWorker modifyTreatment(TreatmentCV treatment)

pourPlates

public javax.swing.SwingWorker pourPlates(MediumCV mediumCV,
                                          java.util.List<java.lang.String> barcodes,
                                          java.util.Date datePoured,
                                          PlateCV plateCV)
Returns a thread that will pour the plates in the String in the medium specified.

Parameters:
mediumCV - the medium to use for the plates
barcodes - a return-separated list of the barcodes of the plates
datePoured - the date the plates were poured
Returns:
a thread that will pour the plates upon execution

loadMasterPlate

public javax.swing.SwingWorker loadMasterPlate(MasterplateLibraryCV mpcv,
                                               java.lang.String description,
                                               java.util.List<java.lang.String> barcodes,
                                               java.io.File file,
                                               BackgroundMutationCV bmcv,
                                               PlateCV pcv)
Returns a thread that will load a new masterplate.

Parameters:
mpcv - the library defining the masterplate
description - a description of the masterplate
barcodes - the return-separated list of barcodes
file - the file where the mapping information is found
bmcv - the background mutation of the plate
Returns:
a thread that will create the new masterplate upon execution

newTreatment

public javax.swing.SwingWorker newTreatment(TreatmentCV treatment)
Returns a thread that will create a new treatment.

Parameters:
treatment - the new treatment to add.
Returns:
a thread that will create the new treatment upon execution

newMutation

public javax.swing.SwingWorker newMutation(BackgroundMutationCV mutationCV)
Returns a thread that will create a new mutation.

Parameters:
mutationCV - the new mutation to add.
Returns:
a thread that will create the new mutation upon execution

newMedium

public javax.swing.SwingWorker newMedium(MediumCV medium)
Returns a thread that will add a new medium.

Parameters:
medium - the new medium to add
Returns:
a thread that will create the new medium upon execution

addTreatmentsToPlates

public javax.swing.SwingWorker addTreatmentsToPlates(java.lang.String plates,
                                                     TreatmentCV treatment,
                                                     java.util.Date date)
Returns a thread that will add the TreatmentCV to the plates in the String.

Parameters:
plates - a string of the return-separated barcodes
treatment - the treatment to be applied to the plates
date - the date of treatment
Returns:
a SwingWorker that will apply the treatments when executed

getTreatmentCVs

public java.util.Collection<TreatmentCV> getTreatmentCVs()
                                                  throws QueryNotFoundException
creates a link to the database and retrieves all treatments.

Returns:
collection of treatments.
Throws:
QueryNotFoundException

getMediumCVs

public java.util.Collection<MediumCV> getMediumCVs()
                                            throws QueryNotFoundException
creates a link to the database and retrieves all mediumCVs.

Returns:
collection of mediumsCV.
Throws:
QueryNotFoundException

getPlateCVs

public java.util.Collection<PlateCV> getPlateCVs()
                                          throws QueryNotFoundException
creates a link to the database and retrieves all plateCVs.

Returns:
collection of plateCVs.
Throws:
QueryNotFoundException

getMasterplateSets

public java.util.Collection<MasterplateSet> getMasterplateSets()
                                                        throws QueryNotFoundException
creates a link to the database and retrieves all masterplates sets.

Returns:
collection of masterplate sets.
Throws:
QueryNotFoundException

getBackgroundMutationCVs

public java.util.Collection<BackgroundMutationCV> getBackgroundMutationCVs()
                                                                    throws QueryNotFoundException
creates a link to the database and retrieves all backgroundMutationCVs.

Returns:
collection of background mutationCVs.
Throws:
QueryNotFoundException

getMasterplateLibraryCVs

public java.util.Collection<MasterplateLibraryCV> getMasterplateLibraryCVs()
                                                                    throws QueryNotFoundException
creates a link to the database and retrieves all MasterplatelibraryCVs.

Returns:
collection of Master plate libraryCVs.
Throws:
QueryNotFoundException

getPlates

public java.util.Collection<Plate> getPlates()
                                      throws QueryNotFoundException
creates a link to the database and retrieves all plates.

Returns:
collection of plates.
Throws:
QueryNotFoundException

hasCurrentTask

public boolean hasCurrentTask()
checks if there are 1 or more current tasks queued by a swingworker.

Returns:
boolean.true if tasks exist, boolean.false if 0 tasks

cancelCurrentTasks

public void cancelCurrentTasks()
cancels all queued tasks for a swingworker.



Copyright © 2010. All Rights Reserved.