uk.ac.cisban.rod.data
Class AbstractDataTypeManager

java.lang.Object
  extended by uk.ac.cisban.rod.data.AbstractDataTypeManager
Direct Known Subclasses:
ExperimentManager, ImageManager, InoculationManager, SpotManager

public abstract class AbstractDataTypeManager
extends java.lang.Object

An abstract class that contains functions needed for every type of data that can be saved into ROD.

Since:
26-Nov-2008 4:15:49 PM
Author:
Morgan Taschuk

Field Summary
protected  java.util.List<StateSwingWorker> currentTasks
          Tasks that are in the process of executing in this DataTypeManager.
protected  java.util.List<javax.swing.event.ChangeListener> listeners
          Listeners that are interested in the changes that happen in this DataTypeManager.
 
Constructor Summary
protected AbstractDataTypeManager()
          Main constructor.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener listener)
          Adds change listener.
 void cancelCurrentTasks()
          cancels all queued tasks for a swingworker.
 boolean hasCurrentTask()
          Checks if there are 1 or more current tasks queued by a SwingWorker.
 boolean hasCurrentTask(long id)
          checks by id number for a specific task for a swingworker.
 java.lang.Boolean isLoaded(long applicationAppId)
          Checks if there are mappings in the DataManager for the given ActionApplication.
 void removeChangeListener(javax.swing.event.ChangeListener listener)
          removes change listener.
protected  void setLoaded(java.lang.Boolean b, java.lang.Object object)
          Sets if the manager has completed its task, and informs all listeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected java.util.List<javax.swing.event.ChangeListener> listeners
Listeners that are interested in the changes that happen in this DataTypeManager. Currently consists of DataManager.


currentTasks

protected java.util.List<StateSwingWorker> currentTasks
Tasks that are in the process of executing in this DataTypeManager. Allows ROD to check if any data access is occurring before quitting.

Constructor Detail

AbstractDataTypeManager

protected AbstractDataTypeManager()
Main constructor.

Method Detail

setLoaded

protected void setLoaded(java.lang.Boolean b,
                         java.lang.Object object)
Sets if the manager has completed its task, and informs all listeners

Parameters:
b - true if the object is loaded, false if not loaded, null if there is confusion
object -

isLoaded

public java.lang.Boolean isLoaded(long applicationAppId)
Checks if there are mappings in the DataManager for the given ActionApplication.

Parameters:
applicationAppId - the DB id
Returns:

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener listener)
Adds change listener.

Parameters:
listener - listener to be added.

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener listener)
removes change listener.

Parameters:
listener - listener to remove.

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

hasCurrentTask

public boolean hasCurrentTask(long id)
checks by id number for a specific task for a swingworker.

Parameters:
id - ID number of task to be searched for.
Returns:
boolean.true if the task exists, boolean.false if not.

cancelCurrentTasks

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



Copyright © 2010. All Rights Reserved.