org.embl.ebi.escience.scuflui.shared
Class ModelMap

java.lang.Object
  extended by org.embl.ebi.escience.scuflui.shared.ModelMap

public class ModelMap
extends java.lang.Object

Map of the models present in the workbench associated with their names, together with the ability to manipulate this. Contains, from version 1.5 onwards, methods to set and notify components of changes to the underlying set of named models. A 'model' can be any Object that has an effect on the UI

Author:
Stuart Owen, Tom Oinn, Stian Soiland

Nested Class Summary
static interface ModelMap.ModelChangeListener
          Register with the static class to inform workbench like systems that the underlying map of named model objects has been altered in some way.
 
Field Summary
static java.lang.String CURRENT_PERSPECTIVE
          Used as a modelName for setModel() and getNamedModel() - notes the current active perspective in the GUI.
static java.lang.String CURRENT_WORKFLOW
          Used as a modelName for setModel() and getNamedModel() - notes the current active workflow in the GUI.
 
Method Summary
 void addModelListener(ModelMap.ModelChangeListener listener)
           
static ModelMap getInstance()
           
 java.util.Set<java.lang.Object> getModels()
          Return the model set
 java.lang.Object getNamedModel(java.lang.String string)
           
 void removeModelListener(ModelMap.ModelChangeListener listener)
           
 void setModel(java.lang.String modelName, java.lang.Object model)
          Manipulate the current model map
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT_WORKFLOW

public static final java.lang.String CURRENT_WORKFLOW
Used as a modelName for setModel() and getNamedModel() - notes the current active workflow in the GUI.

See Also:
Constant Field Values

CURRENT_PERSPECTIVE

public static final java.lang.String CURRENT_PERSPECTIVE
Used as a modelName for setModel() and getNamedModel() - notes the current active perspective in the GUI.

See Also:
Constant Field Values
Method Detail

getInstance

public static ModelMap getInstance()

getModels

public java.util.Set<java.lang.Object> getModels()
Return the model set


setModel

public void setModel(java.lang.String modelName,
                     java.lang.Object model)
Manipulate the current model map

Parameters:
modelName - name of the model to act on
model - null to destroy the model or a reference to the new model to set. If it didn't already exist a modelCreated event will be fired otherwise modelChanged is called.

addModelListener

public void addModelListener(ModelMap.ModelChangeListener listener)

removeModelListener

public void removeModelListener(ModelMap.ModelChangeListener listener)

getNamedModel

public java.lang.Object getNamedModel(java.lang.String string)