Class StimuliCanvas

Class StimuliCanvas

Warning, links to the API class, i.e., java.awt.*, java.lang.*, etc., do not exist. Only links to Poggendoff class exists: the "see also" links.
java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----StimuliCanvas

class StimuliCanvas
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, Results

Constructor Index

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

Method Index

 o Response(String, Button, Button)
This method collects the response from the user, records it in the current TrialObject and advances the trial counter.
 o paint(Graphics)
When paint is called for the first time, we have access to the bounds of the canvas at that time.

Constructors

 o StimuliCanvas
  public StimuliCanvas(double vertLineP,
                       double transP,
                       double dP,
                       double areaP,
                       int t,
                       int numSP,
                       int numTrialsP)
Constructor collects parameters from the html file. These parameters will control display features and will specify experimental variables.
Parameters:
vertLineP - controls the lenght of the 2 vertical line segments
transP - controls the length of the 2 sections of the transverse line segment
dP - controls the seperation between the 2 vertical line segments
areaP - controls the sampling area
t - controls the acute angle between a transversal and vertical line
numSp - specifies the number of comparison line samples to be used
numTrialsP - specifies the number of times a subject will see a sample

Methods

 o Response
  public void Response(String DV,
                       Button high,
                       Button low)
This method collects the response from the user, records it in the current TrialObject and advances the trial counter. If the last trial, the two user buttons will be disabled.
Parameters:
DV - is the user response, "high" or "low"
high - is the "too high" button component
low - is the "too low" button component
Returns:
void
 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

Back to Poggendoff7 class documents