edu.washington.biostr.sig.brainj3d.viewvolume
Class CrossControl

java.lang.Object
  extended by edu.washington.biostr.sig.brainj3d.viewvolume.CrossControl
All Implemented Interfaces:
CommandListener, VolumeControl

public class CrossControl
extends Object
implements VolumeControl

Display a cross over the selected point and when processing mouse events, create a LocationEvent that moves the view to the clicked position.

Author:
eider

Constructor Summary
CrossControl(int type, VolumeDataModel m)
          The type is one of VolumeView.SAGITTAL, CORONAL or TRANSVERSE
 
Method Summary
 boolean doCommand(DoCommand cmd)
          Process a command if this command makes sense for this object (the target is is expected).
 int getMouseEvents()
          Currently this just requires MOUSE_RELEASE
 IconOverlay getOverlay()
          Return the CrossOverlay
protected  boolean handle(double[] newLoc)
          Handle the new location and return true if anything changed.
 DoCommand process(PercentMouseEvent evt)
          Process the event and return a DoEvent that will be dispatched.
 boolean setState(State s)
          Listeners should be careful that the s's ident matches what they are expecting and disregard all other state events.
This implementation provides advantages and disadvantages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrossControl

public CrossControl(int type,
                    VolumeDataModel m)
The type is one of VolumeView.SAGITTAL, CORONAL or TRANSVERSE

Method Detail

getMouseEvents

public int getMouseEvents()
Currently this just requires MOUSE_RELEASE

Specified by:
getMouseEvents in interface VolumeControl
Returns:
See Also:
VolumeControl.getMouseEvents()

getOverlay

public IconOverlay getOverlay()
Return the CrossOverlay

Specified by:
getOverlay in interface VolumeControl
Returns:
See Also:
VolumeControl.getOverlay()

process

public DoCommand process(PercentMouseEvent evt)
Description copied from interface: VolumeControl
Process the event and return a DoEvent that will be dispatched.

Specified by:
process in interface VolumeControl
Returns:

handle

protected boolean handle(double[] newLoc)
Handle the new location and return true if anything changed.

Parameters:
newLoc -
Returns:

doCommand

public boolean doCommand(DoCommand cmd)
Description copied from interface: CommandListener
Process a command if this command makes sense for this object (the target is is expected).

Specified by:
doCommand in interface CommandListener
Returns:
true if any state changed.

setState

public boolean setState(State s)
Description copied from interface: CommandListener
Listeners should be careful that the s's ident matches what they are expecting and disregard all other state events.
This implementation provides advantages and disadvantages. The advantage is that you don't need to register for the right states, all states are fired at you and you can monitor what is going on around you.
The disadvantage is that this may add overhead and it is a potential pitfall.

Specified by:
setState in interface CommandListener
Returns:
true if anything changed.


Copyright © 2006 University of Washington. All Rights Reserved.