Class StimulusExtent

Class StimulusExtent

java.lang.Object
   |
   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.
   |
   +----StimulusExtent
To Go Back click here.
class StimulusExtent
extends Object
This class will return, in pixel units, the seperation of of the two main line
   segements (at the top), how many pixels from the top, bottom, left and right of the
   canvas are needed to center the stimuli, and x, y-components of the extent of a tilted
   line.  SimulusObject will used this class to return variables necessary to draw and
   maintain ponzo graphics.

Method Index

 o Bottom()
This returns how far from the bottom of the canvas one needs the bottoms of the 2
             main, tilted, line segments to be in order for them to appear centered vertically.
 o ClippedOnLeft()
Returns true if the left tilted line will be clipped at the left edge of
             the canvas.
  
 o ClippedOnRight()
Returns true if the right tilted line will be clipped at the right edge of
             the canvas.
  
 o ComputeExtent(int, int, double, double, double)
This function uses parameters from the html file to compute, in pixel units,
      where to place/locate the stimuli so that it is centered on the canvas.
  
 o GetXInterceptOnLeftLine(int)
Returns the x-component of the intercept point on the left tilted line given a y-value
 o GetXInterceptOnRightLine(int)
Returns the x-component of the intercept point on the right tilted line given a y-value
 o InterceptOfLeft()
This method returns y-axis intercept of left line
 o InterceptOfRight()
This method returns y-axis intercept of right line
 o Left()
This method returns how far left the lower point of the right tilted line is on
             the canvas.
 o Length()
This returns the length of the 2 main, tilted, line segments.
 o Right()
This method returns how far right the lower point of the left tilted line is on
             the canvas.
 o Seperation()
This returns the seperation between the tops of the 2 main, tilted, line segments.
 o SeperationAtY(int)
Returns the horizontal seperation of the two tilted lines given a y-value
 o Set_interceptLeft(double)
Sets the class variable "interceptLeft" to the y-axis intercept value of the left tilted line.
 o Set_interceptRight(double)
Sets the class variable "interceptRight" to the y-intercept value of the right tilted line.
 o Set_slopeLeft(double)
Sets the class variable "slopeLeft" to the slope of the left tilted line.
 o Set_slopeRight(double)
Sets the class variable "slopeRight" to the slope of the right tilted line.
 o SlopeOfLeft()
This method returns slope of left line
 o SlopeOfRight()
This method returns slope of right line
 o Top()
This returns how far from the top of the canvas one needs the tops of the 2
        main, tilted, line segments to be in order for them to appear centered vertically.
 o XComp()
This returns the x-component of a tilted main line segment (both right and left
        will have the same y-component.
 o YComp()
This returns the y-component of a tilted main line segment (both right and left
        will have the same y-component.

Methods

 o ComputeExtent
  public void ComputeExtent(int w,
                            int h,
                            double lp,
                            double tp,
                            double sp)
This function uses parameters from the html file to compute, in pixel units,
      where to place/locate the stimuli so that it is centered on the canvas. See public
      methods for what is returned in order to center the stimuli and make sure it is
      not being clipped at the edges of the canvas.
      NOTE that the "top" variable, along with the class variable "bottom" insure that the
      stimuli will not be clipped at the top or bottom of the canvas.  This is
      because the lenght of each main line segment can be no greater than the height of the
      canvas.  Depending on the tilt, however, the 2 main line segements could be clipped on
      the left and right side of the canvas.  This class containts two boolean method to
      check if the stimulus will be clipped by the left and right sides of the canvas.  If
      so, then lp and/sp should be reduced and this object called again until the stimuli
      fit on the canvas.
Parameters:
w - is the width of the canvas
h - is the height of the canvas
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
 o GetXInterceptOnRightLine
  public int GetXInterceptOnRightLine(int y)
Returns the x-component of the intercept point on the right tilted line given a y-value
Parameters:
y - is the y-comp. of the intercept point on the right tilted line.
Returns:
x-component of the intercept point on the right tilted line
 o GetXInterceptOnLeftLine
  public int GetXInterceptOnLeftLine(int y)
Returns the x-component of the intercept point on the left tilted line given a y-value
Parameters:
y - is the y-comp. of the intercept point on the left tilted line.
Returns:
x-component of the intercept point on the left tilted line
 o SeperationAtY
  public int SeperationAtY(int y)
Returns the horizontal seperation of the two tilted lines given a y-value
Parameters:
y - is where I want to calculate the seperation between the 2 tilted lines
Returns:
the seperation of the tilted lines at y
 o Set_slopeRight
  public void Set_slopeRight(double i)
Sets the class variable "slopeRight" to the slope of the right tilted line.
Parameters:
i - is the slope of the right tilted line.
 o Set_slopeLeft
  public void Set_slopeLeft(double i)
Sets the class variable "slopeLeft" to the slope of the left tilted line.
Parameters:
i - is the slope of the left tilted line.
 o Set_interceptRight
  public void Set_interceptRight(double i)
Sets the class variable "interceptRight" to the y-intercept value of the right tilted line.
Parameters:
i - is the y-axis intercept of the right tilted line
 o Set_interceptLeft
  public void Set_interceptLeft(double i)
Sets the class variable "interceptLeft" to the y-axis intercept value of the left tilted line.
Parameters:
i - is the y-axis intercept of the left tilted line
 o Seperation
  public int Seperation()
This returns the seperation between the tops of the 2 main, tilted, line segments.
Parameters:
NULL - no parameters
Returns:
int
 o Length
  public int Length()
This returns the length of the 2 main, tilted, line segments.
Parameters:
NULL - no parameters
Returns:
int
 o YComp
  public int YComp()
This returns the y-component of a tilted main line segment (both right and left
        will have the same y-component.
Parameters:
NULL - no parameters
Returns:
int
 o XComp
  public int XComp()
This returns the x-component of a tilted main line segment (both right and left
        will have the same y-component.
Parameters:
NULL - no parameters
Returns:
int
 o Top
  public int Top()
This returns how far from the top of the canvas one needs the tops of the 2
        main, tilted, line segments to be in order for them to appear centered vertically.
Parameters:
NULL - no parameters
Returns:
int
 o Bottom
  public int Bottom()
This returns how far from the bottom of the canvas one needs the bottoms of the 2
             main, tilted, line segments to be in order for them to appear centered vertically.
Parameters:
NULL - no parameters
Returns:
int
 o Left
  public int Left()
This method returns how far left the lower point of the right tilted line is on
             the canvas.
Parameters:
NULL - no parameters
Returns:
int
 o Right
  public int Right()
This method returns how far right the lower point of the left tilted line is on
             the canvas.
Parameters:
NULL - no parameters
Returns:
int
 o SlopeOfRight
  public double SlopeOfRight()
This method returns slope of right line
Parameters:
NULL - no parameters
Returns:
int
 o SlopeOfLeft
  public double SlopeOfLeft()
This method returns slope of left line
Parameters:
NULL - no parameters
Returns:
int
 o InterceptOfRight
  public double InterceptOfRight()
This method returns y-axis intercept of right line
Parameters:
NULL - no parameters
Returns:
int
 o InterceptOfLeft
  public double InterceptOfLeft()
This method returns y-axis intercept of left line
Parameters:
NULL - no parameters
Returns:
int
 o ClippedOnLeft
  public boolean ClippedOnLeft()
Returns true if the left tilted line will be clipped at the left edge of
             the canvas. Else it returns false.
Parameters:
NULL - no parameters
Returns:
int
 o ClippedOnRight
  public boolean ClippedOnRight()
Returns true if the right tilted line will be clipped at the right edge of
             the canvas. Else it returns false.
Parameters:
NULL - no parameters
Returns:
int