net.sourceforge.pavlov.pluglets.feedback.random
Class DefaultVisualFeedbackMode

java.lang.Object
  extended by net.sourceforge.pavlov.pluglets.feedback.random.DefaultVisualFeedbackMode
Direct Known Subclasses:
BeginnerFeedbackMode, ExpertFeedbackMode, IntermediateFeedbackMode

public class DefaultVisualFeedbackMode
extends Object

A visual feedback mode is a strategy for altering an image based on a user's correct or incorrect response.


Field Summary
protected  int decrement
          How much the size is decreased for an incorrect response.
protected  int increment
          How much the size is increased for a correct response.
protected  int initialSize
          The initial size of an image in this mode.
protected  String message
          A message describing how the image was changed in response to the last answer.
protected  int minimumSize
          The minimum size of an image in this mode.
protected  String name
          A descriptive name for this mode.
protected  int size
          Current image size.
 
Constructor Summary
DefaultVisualFeedbackMode(int is, int inc, int dec, int minSz)
          Creates a new DefaultVisualFeedbackMode instance.
 
Method Summary
 String getMessage()
          Return a message that explains the feedback action taken.
 String getShortName()
          Return a user-understandable name for the behaviour of this mode.
 int getSize()
          Gets the current image size.
 void rightEvent()
          The user answered correctly.
 void setName(String _n)
          Set the user-understandable name for the behaviour of this mode.
 void setSize(int what)
          Sets the current image size.
 String toString()
          Returns this mode's name as a String.
 void wrongEvent()
          The user answered incorrectly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

initialSize

protected int initialSize
The initial size of an image in this mode.


minimumSize

protected int minimumSize
The minimum size of an image in this mode.


increment

protected int increment
How much the size is increased for a correct response.


decrement

protected int decrement
How much the size is decreased for an incorrect response.


size

protected int size
Current image size.


name

protected String name
A descriptive name for this mode.


message

protected String message
A message describing how the image was changed in response to the last answer.

Constructor Detail

DefaultVisualFeedbackMode

public DefaultVisualFeedbackMode(int is,
                                 int inc,
                                 int dec,
                                 int minSz)
Creates a new DefaultVisualFeedbackMode instance.

Parameters:
is - an int value
inc - an int value
dec - an int value
minSz - an int value
Method Detail

getSize

public int getSize()
Gets the current image size.

Returns:
an int value

setSize

public void setSize(int what)
Sets the current image size. Will not set below the minimum size.

Parameters:
what - an int value

rightEvent

public void rightEvent()
The user answered correctly.


wrongEvent

public void wrongEvent()
The user answered incorrectly.


toString

public String toString()
Returns this mode's name as a String.

Overrides:
toString in class Object
Returns:
a String value

setName

public void setName(String _n)
Set the user-understandable name for the behaviour of this mode.

Parameters:
_n - a String value

getShortName

public String getShortName()
Return a user-understandable name for the behaviour of this mode.

Returns:
a String value

getMessage

public String getMessage()
Return a message that explains the feedback action taken.

Returns:
a String value