edu.washington.biostr.sig.brainj3d.doevents
Interface DoTarget

All Known Subinterfaces:
DataTarget
All Known Implementing Classes:
DefaultDoTarget, ImageViewPort, MapViewPort, Model3DViewPort, PlainTextViewPort, ViewPort, VolumeViewPort

public interface DoTarget

A DoTarget represents the target for events (and can be a source of events). It also has the responsibilty of dispatching new events and keeping track of old events for the purpose of undoing and redoing actions.

Author:
eider

Method Summary
 void addListener(CommandListener l)
          Add a DoListener.
 State addState(State state)
           
 boolean canRedo()
          Return true if there are events to redo.
 boolean canUndo()
          Return true if there are events to undo.
 void dispatchEvent(DoCommand evt)
          Put evt in the event queue.
 boolean fireCommand(DoCommand cmd)
           
 boolean fireState(State state)
          Fire a new state at all command listeners
 State getCurrentState(Object target)
           
<T> T
getParameter(FileGroup key, String name, T defaultValue)
          Get the parameter for the specified key and name.
 State getStableState(Object target)
           
 Set<Tag> getTags(FileGroup key)
          Get the available tags for specified FileGroup.
 State processState(DoCommand cmd)
          have cmd change the state, but don't fire an event.
 void redo()
          Do the last undone event.
 void registerCursor(String name, String url, Point hotspot)
          Register the cursor.
 void removeControl(Object control)
          Remove the control if this supports plugable controls.
 void removeListener(CommandListener l)
          Remove a DoListener
 void setControl(Object control, String cursor)
          Add the control if this supports plugable controls.
 void setParameter(FileGroup key, String name, Object value)
          Set the parameter
 void setParameters(FileGroup key, Map<String,Object> parameters)
          Do a bulk set of parameters.
 void setUndo(boolean canUndo)
           
 void undo()
          undo the last event.
 

Method Detail

fireState

boolean fireState(State state)
Fire a new state at all command listeners

Parameters:
evt -
Returns:

processState

State processState(DoCommand cmd)
have cmd change the state, but don't fire an event.

Parameters:
cmd -
Returns:

fireCommand

boolean fireCommand(DoCommand cmd)

getCurrentState

State getCurrentState(Object target)

getStableState

State getStableState(Object target)

addState

State addState(State state)

addListener

void addListener(CommandListener l)
Add a DoListener. The listener will be called every time a DoEvent occurs on this DoTarget.

Parameters:
l -

dispatchEvent

void dispatchEvent(DoCommand evt)
Put evt in the event queue.

Parameters:
evt -

undo

void undo()
undo the last event.


redo

void redo()
Do the last undone event.


canUndo

boolean canUndo()
Return true if there are events to undo.

Returns:

canRedo

boolean canRedo()
Return true if there are events to redo.

Returns:

removeListener

void removeListener(CommandListener l)
Remove a DoListener

Parameters:
l -

setControl

void setControl(Object control,
                String cursor)
Add the control if this supports plugable controls. It must be set up in such a way that there is always a control and it can be replaced at any time.

Parameters:
control -

removeControl

void removeControl(Object control)
Remove the control if this supports plugable controls. This should be replaced by the last control used that is still valid.

Parameters:
control -

setUndo

void setUndo(boolean canUndo)

registerCursor

void registerCursor(String name,
                    String url,
                    Point hotspot)
Register the cursor.

Parameters:
name -
url -
hotspot -

getParameter

<T> T getParameter(FileGroup key,
                   String name,
                   T defaultValue)
Get the parameter for the specified key and name. Return defaultValue if it is the wrong type.

Type Parameters:
T -
Parameters:
key -
name -
defaultValue -
Returns:

setParameter

void setParameter(FileGroup key,
                  String name,
                  Object value)
Set the parameter

Parameters:
key -
name -
value - must be of type String or a primitive wrapper.
Throws:
IllegalArgumentException - if value is the wrong type.

setParameters

void setParameters(FileGroup key,
                   Map<String,Object> parameters)
Do a bulk set of parameters.

Parameters:
key -
parameters -
Throws:
IllegalArgumentException - if any value is the wrong type.

getTags

Set<Tag> getTags(FileGroup key)
Get the available tags for specified FileGroup.

Parameters:
key -
Returns:


Copyright © 2006 University of Washington. All Rights Reserved.