Class ExperimentObject

Class ExperimentObject

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
        Warning: links to the API classes above do not exist.  Only links to the 
        Ponzo classes and the "see also" classes exist. If you choose a link 
        that does not exist, simply hit the right mouse button to return to this frame.
                   |
                   +----ExperimentObject
To Go Back click here.
class ExperimentObject
extends Canvas
This class first creates the graphical objects to be drawn and then initializes all trials with trial-specific condition information. It will control the collection of responses and will launch the results window.
See Also:
StimulusObject, ListOfTrials, Results7

Constructor Index

 o ExperimentObject(double, double, double, int, double, double, double, double, int, double, double, Ponzo7)
Constructor collects parameters from the html file.

Method Index

 o ChangeCmpSize(boolean, Button, Button)
 This is called when the comparison line needs to change size.
  
 o CurrentTrial()
Return value of trial counter (current trial counter)
 o EndTrial()
 This is called when the the trial ends.
  
 o Gaussian(double, double)
This method returns a random function following a Gaussian distribution.
 o GetApplet()
Returns a handle to the Ponzo applet
 o Next(Button, Button, Button, Button)
 This is called when the next button is pressed.
  
 o paint(Graphics)
When paint is called for the first time, we have access to the
      bounds of the canvas at that time.
  
 o TotalNumberOfTrials()
Return total number of trials for this experiment

Constructors

 o ExperimentObject
  public ExperimentObject(double repeatP,
                          double delayP,
                          double lp,
                          int tp,
                          double sp,
                          double stdP,
                          double step,
                          double meanCP,
                          int numP,
                          double stdInsetsP,
                          double cmpInsetsP,
                          Ponzo7 a)
Constructor collects parameters from the html file.  These parameters will control
      display features and will specify experimental variables.  Note that since stimlus
      features depend on canvas size, I must wait until the event manager calls Canvas.paint()
      before I can find out what the canvas size and initialize the stimulus.
Parameters:
lp - controls main, tilted line segment length
tp - controls tilt of main line segments
sp - controls seperation between the tops of the 2 main, tilted, line segments
dp - controls the seperation between the standard and comparison lines
stdP - controls position of the standard line
step - controls step size of cmp. line change during a trial
meanCAscP - is the average starting cmp. line lenght for an ascending type of trial
meanDDecP - is the average starting cmp. line lenght for a decesending type of trial
numAP - is the number of ascending type of trials
numDP - is the number of decending type of trials
stdInsetsP - controls spacing between std. line and the 2 tilted lines
cmpInsetsP - controls the distance between the tilted lines & longest possible cmp. line

Methods

 o GetApplet
  public Applet GetApplet()
Returns a handle to the Ponzo applet
Parameters:
NULL - no parameters
Returns:
Applet the Ponzo applet
 o paint
  public void paint(Graphics g)
When paint is called for the first time, we have access to the
      bounds of the canvas at that time.  This is important because the
      features of the lines, at the beginning of each trial, require this
      info.  The paint routine first checks to see if the experiment has
      started (i.e., the variable that keeps track of the number of trials
      is greater than 0)--if not, a trial initialization routine is called
      and based on the info. in the first trial object, features of the
      lines are initialized.  It also calls the drawing methods of all
      graphics objects
Parameters:
g - - the Graphics objects attached to the current canvas
Returns:
void
Overrides:
paint in class Canvas
 o Gaussian
  public double Gaussian(double m,
                         double s)
This method returns a random function following a Gaussian distribution. (adapted from Press et al : Numerical recipe in C.) The random number generator used in this algorithm must return a double in the range [0.0, 1.0).
Parameters:
m - is the mean
s - is the variance
Returns:
the normally distributed random value
 o Next
  public void Next(Button l,
                   Button e,
                   Button s,
                   Button n)
 This is called when the next button is pressed.  It sets the "nextPressed" flag
       to true.  When this happens, in the paint() method of this class, either the stimuli
       for the next trial is presented or the experiment ends and the results window(s) is (are)
       presented.
Parameters:
null - no parameters
Returns:
void
 o ChangeCmpSize
  public void ChangeCmpSize(boolean thresholdP,
                            Button button1,
                            Button button2)
 This is called when the comparison line needs to change size.  It sets the "changeSize"
       flag to true and this class's paint() routine uses this flag to change the size of the cmp.
       line. This routine will also disable any enabled buttons for the period of the delay.  After
       this time, those buttons will be enabled.
Parameters:
threshold - lets the paint routine know if a upper or lower threshold needs to be calculated.
button1 - is one interface button that needs to be disabled for the period of the delay.
button2 - is another interface button that needs to be disabled for the period of the delay.
Returns:
void
 o EndTrial
  public void EndTrial()
 This is called when the the trial ends.  It sets the "endTrial" flag to true
       and this class's paint() method will collect the DVs for the current trial.
  
Parameters:
null - no parameters
Returns:
void
 o CurrentTrial
  public int CurrentTrial()
Return value of trial counter (current trial counter)
Parameters:
NULL - no parameters
Returns:
int the current trial number
 o TotalNumberOfTrials
  public int TotalNumberOfTrials()
Return total number of trials for this experiment
Parameters:
NULL - no parameters
Returns:
int total number of trials