The Physiologist's Friend Simulation API

ch.unizh.ini.friend.gui
Class StimulusAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ch.unizh.ini.friend.gui.StimulusAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
StimulusAction.Brighten, StimulusAction.BrightenBackground, StimulusAction.Darken, StimulusAction.DarkenBackground, StimulusAction.FlipContrast, StimulusAction.Rotate

public abstract class StimulusAction
extends AbstractAction

Actions that can happen to the stimulus. Use these classes in a GUI by simply adding a new action to a menu, e.g.:

 Stimulus stimulus; // defined earlier
 menu.add(new StimulusAction.Rotate(stimulus);
 
The ActionListener.actionPerformed(java.awt.event.ActionEvent) method will be called automagically when the menu item is selected.

Version:
$Revision: 1.3 $
Author:
tobi $Author: tobi $
See Also:
Serialized Form

Nested Class Summary
static class StimulusAction.Brighten
          brightens the stimulus
static class StimulusAction.BrightenBackground
          brightens background
static class StimulusAction.Darken
          darkens the stimulus
static class StimulusAction.DarkenBackground
          darkens background
static class StimulusAction.FlipContrast
          Swaps foreground and background brightnesses.
static class StimulusAction.Rotate
          rotates the stimulus.
 
Field Summary
protected static String brighten
          name of action that can happen to Stimulus
protected static String brightenBackground
          name of action that can happen to Stimulus
protected static String darken
          name of action that can happen to Stimulus
protected static String darkenBackground
          name of action that can happen to Stimulus
protected static String flipContrast
          name of action that can happen to Stimulus
protected static String rotate
          name of action that can happen to Stimulus
protected  Stimulus stimulus
          the stimulus
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
protected StimulusAction()
          Creates a new instance of StimulusAction
protected StimulusAction(String name)
           
protected StimulusAction(String name, Icon icon)
           
 
Method Summary
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

rotate

protected static final String rotate
name of action that can happen to Stimulus

See Also:
Constant Field Values

brighten

protected static final String brighten
name of action that can happen to Stimulus

See Also:
Constant Field Values

darken

protected static final String darken
name of action that can happen to Stimulus

See Also:
Constant Field Values

brightenBackground

protected static final String brightenBackground
name of action that can happen to Stimulus

See Also:
Constant Field Values

darkenBackground

protected static final String darkenBackground
name of action that can happen to Stimulus

See Also:
Constant Field Values

flipContrast

protected static final String flipContrast
name of action that can happen to Stimulus

See Also:
Constant Field Values

stimulus

protected Stimulus stimulus
the stimulus

Constructor Detail

StimulusAction

protected StimulusAction()
Creates a new instance of StimulusAction


StimulusAction

protected StimulusAction(String name)

StimulusAction

protected StimulusAction(String name,
                         Icon icon)

http://www.ini.unizh.ch/~tobi/friend