edu.washington.biostr.sig.brainj3d.data
Interface DataView

All Known Subinterfaces:
MapView, Surface3DView, View3D, VolumeView
All Known Implementing Classes:
AbstractVolumeView, BrainInfoAtlasDataView, BranchGroupSurface3DView, ColorizedVolumeSurface3DView, ColorizedVolumeSurface3DView.KernelMaskView, DefaultDataView, ImageView, IndexedSurface3DView, LabelDataView, MapSurface3DView, MapVolumeView, PlainTextView, QuickPlugin, SharingDataView, VolumeDataView, VolumeIsosurfaceView, VolumePlaneView, VolumeSurface3DView

public interface DataView

Title:

Description:

Copyright: Copyright (c) 2003

Company:

The DataView provides a view of the data that lets us see the data in different ways and provides useful convenience classes. The DataView is not shared between tools, and a given type of Data may have several different views. Every DataView should have a no argument constructor so that it can be used by the DataViewFactory. Additionally the DataView should be fully initialized after a call to setData(String name, Data data). DataViews are not required to be thread safe. External synchronization should occur on the DataView object and acquiring the lock for multiple DataView's at once is STRONGLY discouraged. If you must, they should be acquired in the natural order of the class name.
Odd Note
I get the feeling that there is a gotcha in most of my implmentations of DataViews. I think that if you don't call getController(FileGroup, DoTarget) soon after creating it (before doing most other things), odd problems might occur.

Version:
1.0
Author:
not attributable

Method Summary
 void addedToModel(DataModel<?> model)
          Notify this data that it was or will be added to the model.
 DataController getController(DataKey dataKey, DoTarget target)
          Get the controller for this DataView.
 Data getData()
          Return the data object associated with this view.
 DataKey getDataKey()
          Get the datakey for this view.
 int getInterval()
           
 FileGroup getKey()
          Return the key for this data.
 int getMaxTime()
           
 int getMinTime()
           
 Map<String,Object> getParameters()
          Get all of the parameters
 DoTarget getTarget()
           
 String getViewName()
          Get a name that should identify this type of view, but not this individual view.
 boolean hasTime()
           
 void removedFromModel()
          Notify this data that it was removed from model.
 void setData(FileGroup dataKey, Data data)
          Initialize this view with the given data and the specified meta data (in the form of a map of tags).
throw an ImmutableException if it is called more than once.
 void setDefaultParameters(Set<Tag> metadata)
          Restore the defaults parameters.
 Object setParameter(String key, Object parameter)
          Set the given parameter to key, parameter.
 void setParameters(Map<String,Object> parameters)
          Set the parameters to have only the data in parameters.
 void setTarget(DoTarget target)
           
 

Method Detail

setData

void setData(FileGroup dataKey,
             Data data)
             throws ClassCastException
Initialize this view with the given data and the specified meta data (in the form of a map of tags).
throw an ImmutableException if it is called more than once. If the data is an inappropriate type, this should throw a ClassCastException. Acceptable types should be clearly documented.

Parameters:
dataKey -
data -
tags - is a map of metadata.
Throws:
ClassCastException - if data's class is the wrong type.

getData

Data getData()
Return the data object associated with this view.

Returns:

removedFromModel

void removedFromModel()
Notify this data that it was removed from model.


addedToModel

void addedToModel(DataModel<?> model)
Notify this data that it was or will be added to the model. The model may return false for contains(this).


getController

DataController getController(DataKey dataKey,
                             DoTarget target)
Get the controller for this DataView.

Parameters:
dataKey -
target - The target or null if the target remains unchanged
Returns:

getKey

FileGroup getKey()
Return the key for this data.

Returns:

setDefaultParameters

void setDefaultParameters(Set<Tag> metadata)
Restore the defaults parameters.

Parameters:
metadata - Use metadata to customize the view.

setParameters

void setParameters(Map<String,Object> parameters)
Set the parameters to have only the data in parameters.

Parameters:
parameters -

setParameter

Object setParameter(String key,
                    Object parameter)
Set the given parameter to key, parameter.

Parameters:
key -
parameter -
Returns:
the old parameter

getParameters

Map<String,Object> getParameters()
Get all of the parameters

Returns:

getViewName

String getViewName()
Get a name that should identify this type of view, but not this individual view.

Returns:

hasTime

boolean hasTime()
Returns:
true if this data has a time component, false if this is constant with time.

getMinTime

int getMinTime()
Returns:
the minimum time value

getMaxTime

int getMaxTime()
Returns:
the maximum time value.

getInterval

int getInterval()
Returns:
the interval between time points.

getDataKey

DataKey getDataKey()
Get the datakey for this view.

Returns:

setTarget

void setTarget(DoTarget target)

getTarget

DoTarget getTarget()


Copyright © 2006 University of Washington. All Rights Reserved.