edu.washington.biostr.sig.brainj3d.view3D
Class BrainInfoAtlasController

java.lang.Object
  extended by edu.washington.biostr.sig.brainj3d.doevents.AbstractDataController<BrainInfoAtlasDataView>
      extended by edu.washington.biostr.sig.brainj3d.view3D.BrainInfoAtlasController
All Implemented Interfaces:
CommandListener, Controller, DataController, Listener, Observer

public class BrainInfoAtlasController
extends AbstractDataController<BrainInfoAtlasDataView>
implements Observer

Display controls for the BrainInfoAtlasDataView. This allows several custom visualization modes that may be appropriate for atlas data.
These include a flat option that eliminates contour and the ability to assign each part a custom color. It also allows any subpart to be switched on or off and provide links to BrainInfo.

Version:
1.1
Author:
Eider Moore

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.washington.biostr.sig.brainj3d.doevents.AbstractDataController
AbstractDataController.SetValues
 
Constructor Summary
BrainInfoAtlasController()
           
BrainInfoAtlasController(BrainInfoAtlasDataView dataView, DataKey dataKey)
           
 
Method Summary
protected  void buildView()
           
 SwingHTMLObject getControl()
          Return the controls.
 String getControlName()
          Get the display name of the control.
 SwingHTMLObject getEditor()
           
protected  Executor getGUIThread()
          Get the GUI thread.
 SwingHTMLObject getViewer()
           
static int insertBreaks(String s, StringBuilder target)
          If a string is too long, then insert breaks as needed
 void requestFocus()
          Request focus.
 void setGUIValues(Map<String,Object> g)
          Set the GUI values.
 void somethingHappened(Event evt)
          If evt instanceof SHPropertyEvent then we automatically dispatch a ParemeterEvent with evt.getName() as the name, the DataKey as the target and evt.getData() as the data.
If this doesn't work for all of the GUI elements, than override this and handle those elements individually with a fallthrough like:
else {
super.somethingHappened(evt)
}
 void update(Observable o, Object arg)
           
protected  void viewWasSet(BrainInfoAtlasDataView view, DataKey key)
          This is called when the data view is set.
 
Methods inherited from class edu.washington.biostr.sig.brainj3d.doevents.AbstractDataController
addListener, doCommand, fireCommand, fireStateChange, getCastView, getDataKey, getDataView, getEdit, getEditButtonText, getTarget, initUI, isEditable, isFocus, isVisible, monitorUpdates, removeListener, setDataView, setDoTarget, setEdit, setFocus, setState, setVisible, updateGUIValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrainInfoAtlasController

public BrainInfoAtlasController(BrainInfoAtlasDataView dataView,
                                DataKey dataKey)

BrainInfoAtlasController

public BrainInfoAtlasController()
Method Detail

getEditor

public SwingHTMLObject getEditor()

getGUIThread

protected Executor getGUIThread()
Description copied from class: AbstractDataController
Get the GUI thread. This can be accomplished simply by getting the thread attached to an SwingHTMLObject (using the getExecutor() method).
Note:
this cannot get it itself because it has no GUI objects.

Specified by:
getGUIThread in class AbstractDataController<BrainInfoAtlasDataView>
Returns:

viewWasSet

protected void viewWasSet(BrainInfoAtlasDataView view,
                          DataKey key)
Description copied from class: AbstractDataController
This is called when the data view is set.

Specified by:
viewWasSet in class AbstractDataController<BrainInfoAtlasDataView>

buildView

protected void buildView()

insertBreaks

public static int insertBreaks(String s,
                               StringBuilder target)
If a string is too long, then insert breaks as needed

Parameters:
s - The source
target - The target where the result is placed.
Returns:
the longest line length.

setGUIValues

public void setGUIValues(Map<String,Object> g)
Description copied from class: AbstractDataController
Set the GUI values. This will be called in the GUI thread.

Specified by:
setGUIValues in class AbstractDataController<BrainInfoAtlasDataView>

getViewer

public SwingHTMLObject getViewer()

getControl

public SwingHTMLObject getControl()
Description copied from interface: Controller
Return the controls. The name of the SwingHTMLObject should be meaningful.

Specified by:
getControl in interface Controller
Returns:

update

public void update(Observable o,
                   Object arg)
Specified by:
update in interface Observer

getControlName

public String getControlName()
Description copied from interface: Controller
Get the display name of the control.

Specified by:
getControlName in interface Controller
Returns:

requestFocus

public void requestFocus()
Description copied from class: AbstractDataController
Request focus. For those DataControllers using a viewport, use the following code:
if (getTarget() instanceof ViewPort)
{
((ViewPort) getTarget()).requestFocus(getDataKey());
}
Note:
This cannot directly use the above code because it should depend on the viewport.

Specified by:
requestFocus in interface Controller
Overrides:
requestFocus in class AbstractDataController<BrainInfoAtlasDataView>

somethingHappened

public void somethingHappened(Event evt)
Description copied from class: AbstractDataController
If evt instanceof SHPropertyEvent then we automatically dispatch a ParemeterEvent with evt.getName() as the name, the DataKey as the target and evt.getData() as the data.
If this doesn't work for all of the GUI elements, than override this and handle those elements individually with a fallthrough like:
else {
super.somethingHappened(evt)
}

Specified by:
somethingHappened in interface Listener
Overrides:
somethingHappened in class AbstractDataController<BrainInfoAtlasDataView>


Copyright © 2006 University of Washington. All Rights Reserved.