comirva
Class Workspace

java.lang.Object
  extended by comirva.Workspace
All Implemented Interfaces:
Serializable

public class Workspace
extends Object
implements Serializable

This class implements a workspace environment containing data matrices and meta-data instances and the respective lists.

See Also:
Serialized Form

Field Summary
protected  Vector<DefaultListModel> additionalListMatrices
           
protected  Vector<Vector> additionalMatrixList
           
protected  Vector<String> additionalMatrixNames
           
protected  DefaultListModel listMatrices
           
protected  DefaultListModel listMetaData
           
protected  DefaultListModel listVisu
           
protected  Vector matrixList
           
protected  Vector metaDataList
           
protected  Vector<VisuListItem> visuList
           
 
Constructor Summary
Workspace()
          Creates a new empty instance of the Workspace.
 
Method Summary
 void addMatrix(DataMatrix dm, String name)
          Adds a data matrix to the Workspace instance.
 void addMetaData(Vector meta, String name)
          Adds a meta-data Vector to the Workspace instance.
 void addVisu(VisuListItem visu, String name)
          Adds a visualisation to the Workspace instance
 int countVisuTypes(String className)
          counts the amount of visus of class given by its class name.
 Vector<VisuListItem> getVisuListItems(String className)
          creates a vector containing only the visualizations of the type given by the class name.
 Vector<String> getVisuListNames(String className)
          creates a vector containing the names
 String[] getVisuListNamesArray(String className)
          This method returns a string array containing the names of visualisation of the type given by the class name.
 String[] getVisuListNamesArray(String className, int count)
          This method returns a string array containing the names of visualisation of the type given by the class name.
 void printVisuTypes()
          print the stored visualisation types to standard system output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listMatrices

protected DefaultListModel listMatrices

matrixList

protected Vector matrixList

additionalListMatrices

protected Vector<DefaultListModel> additionalListMatrices

additionalMatrixList

protected Vector<Vector> additionalMatrixList

additionalMatrixNames

protected Vector<String> additionalMatrixNames

listVisu

protected DefaultListModel listVisu

visuList

protected Vector<VisuListItem> visuList

listMetaData

protected DefaultListModel listMetaData

metaDataList

protected Vector metaDataList
Constructor Detail

Workspace

public Workspace()
Creates a new empty instance of the Workspace.

Method Detail

addMetaData

public void addMetaData(Vector meta,
                        String name)
Adds a meta-data Vector to the Workspace instance.

Parameters:
meta - a Vector containing the meta-data as Strings
name - a String containing a name for the meta-data which is shown in CoMIRVA's UI

addMatrix

public void addMatrix(DataMatrix dm,
                      String name)
Adds a data matrix to the Workspace instance.

Parameters:
dm - a DataMatrix representing the data matrix to be inserted
name - a String containing a name for the data matrix which is shown in CoMIRVA's UI

addVisu

public void addVisu(VisuListItem visu,
                    String name)
Adds a visualisation to the Workspace instance

Parameters:
visu - a Visualisation object representing the visualisation
name - a String containing a name for the Visualisation which is shown in CoMIRVA's UI

printVisuTypes

public void printVisuTypes()
print the stored visualisation types to standard system output


countVisuTypes

public int countVisuTypes(String className)
counts the amount of visus of class given by its class name. The given class name must be equal (in sense of the equals() method) to the name that is returned by the getClass().getName() method of the visualisation object added to the visualisation list.

Parameters:
className - The name of the class that should be counted
Returns:
the amount of classes in the list

getVisuListItems

public Vector<VisuListItem> getVisuListItems(String className)
creates a vector containing only the visualizations of the type given by the class name. The given class name must be equal (in sense of the equals() method) to the name that is returned by the getClass().getName() method of the visualization object.

Parameters:
className - The name of the class
Returns:
a list (vector) containing the elements of the given class

getVisuListNames

public Vector<String> getVisuListNames(String className)
creates a vector containing the names

Parameters:
className -
Returns:
a vector containing the names of the visualizations of the desired type

getVisuListNamesArray

public String[] getVisuListNamesArray(String className)
This method returns a string array containing the names of visualisation of the type given by the class name. The given class name must be equal (in sense of the equals() method) to the name returned by the getClass().getName() method of the visualisation object. This method calls the countVisuTypes(String) method in order to determined the required size of the String array that will be returned. If you have done such a count before in your count (e.g. for existence testing or if you want to bring up an input dialog only if there are more than one possibilities) you may consider using getVisuListNamesArray(String, int) instead.

Parameters:
className - The name of the class
Returns:
an array containing the names of the given type

getVisuListNamesArray

public String[] getVisuListNamesArray(String className,
                                      int count)
This method returns a string array containing the names of visualisation of the type given by the class name. The given class name must be equal (in sense of the equals() method) to the name returned by the getClass().getName() method of the visualisation object. This method may be used if you already know how many visualisations are present in the list (by calling the countVisuTypes(String) method, e.g. for checking if there is any visualisation of that type in the list or checking if there are more than one for showing an input dialog etc.). In this case you pass the amount as second parameter to save the call to the countVisuTypes(String) method. WARNING: There is no check on the count parameter. This may cause an Exception (mainly an IndexOutOfBoundException) if the value is not correct

Parameters:
className - The name of the class
count - The amount of visualisations of that type in the list
Returns:
an array containing the names of the given type