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 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, ycomponents of the extent of a tilted
line. SimulusObject will used this class to return variables necessary to draw and
maintain ponzo graphics.

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.

ClippedOnLeft()

Returns true if the left tilted line will be clipped at the left edge of
the canvas.

ClippedOnRight()

Returns true if the right tilted line will be clipped at the right edge of
the canvas.

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.

GetXInterceptOnLeftLine(int)
 Returns the xcomponent of the intercept point on the left tilted line given a yvalue

GetXInterceptOnRightLine(int)
 Returns the xcomponent of the intercept point on the right tilted line given a yvalue

InterceptOfLeft()

This method returns yaxis intercept of left line

InterceptOfRight()

This method returns yaxis intercept of right line

Left()

This method returns how far left the lower point of the right tilted line is on
the canvas.

Length()
 This returns the length of the 2 main, tilted, line segments.

Right()

This method returns how far right the lower point of the left tilted line is on
the canvas.

Seperation()
 This returns the seperation between the tops of the 2 main, tilted, line segments.

SeperationAtY(int)
 Returns the horizontal seperation of the two tilted lines given a yvalue

Set_interceptLeft(double)
 Sets the class variable "interceptLeft" to the yaxis intercept value of the left tilted line.

Set_interceptRight(double)
 Sets the class variable "interceptRight" to the yintercept value of the right tilted line.

Set_slopeLeft(double)
 Sets the class variable "slopeLeft" to the slope of the left tilted line.

Set_slopeRight(double)
 Sets the class variable "slopeRight" to the slope of the right tilted line.

SlopeOfLeft()

This method returns slope of left line

SlopeOfRight()

This method returns slope of right line

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.

XComp()

This returns the xcomponent of a tilted main line segment (both right and left
will have the same ycomponent.

YComp()

This returns the ycomponent of a tilted main line segment (both right and left
will have the same ycomponent.
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
GetXInterceptOnRightLine
public int GetXInterceptOnRightLine(int y)
 Returns the xcomponent of the intercept point on the right tilted line given a yvalue
 Parameters:
 y  is the ycomp. of the intercept point on the right tilted line.
 Returns:
 xcomponent of the intercept point on the right tilted line
GetXInterceptOnLeftLine
public int GetXInterceptOnLeftLine(int y)
 Returns the xcomponent of the intercept point on the left tilted line given a yvalue
 Parameters:
 y  is the ycomp. of the intercept point on the left tilted line.
 Returns:
 xcomponent of the intercept point on the left tilted line
SeperationAtY
public int SeperationAtY(int y)
 Returns the horizontal seperation of the two tilted lines given a yvalue
 Parameters:
 y  is where I want to calculate the seperation between the 2 tilted lines
 Returns:
 the seperation of the tilted lines at y
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.
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.
Set_interceptRight
public void Set_interceptRight(double i)
 Sets the class variable "interceptRight" to the yintercept value of the right tilted line.
 Parameters:
 i  is the yaxis intercept of the right tilted line
Set_interceptLeft
public void Set_interceptLeft(double i)
 Sets the class variable "interceptLeft" to the yaxis intercept value of the left tilted line.
 Parameters:
 i  is the yaxis intercept of the left tilted line
Seperation
public int Seperation()
 This returns the seperation between the tops of the 2 main, tilted, line segments.
 Parameters:
 NULL  no parameters
 Returns:
 int
Length
public int Length()
 This returns the length of the 2 main, tilted, line segments.
 Parameters:
 NULL  no parameters
 Returns:
 int
YComp
public int YComp()

This returns the ycomponent of a tilted main line segment (both right and left
will have the same ycomponent.
 Parameters:
 NULL  no parameters
 Returns:
 int
XComp
public int XComp()

This returns the xcomponent of a tilted main line segment (both right and left
will have the same ycomponent.
 Parameters:
 NULL  no parameters
 Returns:
 int
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
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
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
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
SlopeOfRight
public double SlopeOfRight()

This method returns slope of right line
 Parameters:
 NULL  no parameters
 Returns:
 int
SlopeOfLeft
public double SlopeOfLeft()

This method returns slope of left line
 Parameters:
 NULL  no parameters
 Returns:
 int
InterceptOfRight
public double InterceptOfRight()

This method returns yaxis intercept of right line
 Parameters:
 NULL  no parameters
 Returns:
 int
InterceptOfLeft
public double InterceptOfLeft()

This method returns yaxis intercept of left line
 Parameters:
 NULL  no parameters
 Returns:
 int
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
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