fundamentals
Class mouseInfo

java.lang.Object
  |
  +--fundamentals.mouseInfo
All Implemented Interfaces:
java.lang.Cloneable

public class mouseInfo
extends java.lang.Object
implements java.lang.Cloneable

The mouseInfo contains information describing how a porion of the real plane and the mathematical objects on it are displayed. This informations is also used to convert the user's clicks to mathematical positions.


Field Summary
static int AS_TARGET
          Reference to the color used for objects given as targets.
static int BACKGROUND
          Reference to the background color.
static int BY_PREMISE
          Reference to the color used for objects given as premise.
static int CONSTRUCTED
          Reference to the color used for constructed objects.
static int CONSTRUCTED_TARGET
          Reference to the color used for self-constructed targets.
static int DIVIDER
          Reference to the color of dividers.
static int EAST
           
static int ERROR
          Reference to the color of dividers.
 double initialMinMax
          Initial value, @see mouseInfo
 double maxSize
          The longest side of the rectangle which is actually displayed
 double minSize
          The side of the square which must be displayed
static int NE
           
static int NORTH
           
static int NW
           
static int radiusCorner
          The corner to use when drawing radii
 double scale
          Object scaling; the lenght of a mathematical unit vector in pixels
static int SE
           
static int SECONDARY
          Reference to the color used for recycled objects.
static int SELECT
          Reference to the color used for selecting visible objects.
static int SHADOW
          Reference to the color of invisible objects.
static int SOUTH
           
static int SW
           
static int WEST
           
 int x0
          Object offset; the first pixel coordinate of the (0,0) mathematical point
 int xAvailable
          Number of pixels available on the x-axis
 double xCenter
          The x-value of the center of the square which must be displayed
 int xCorner
          Leftmost pixel column used to display the current lab
 double xSize
          The width of the square being displayed
 int y0
          Object offset; the second pixel coordinate of the (0,0) mathematical point
 int yAvailable
          Number of pixels available on the y-axis
 double yCenter
          The y-value of the center of the square which must be displayed
 int yCorner
          Topmost pixel row used to display the current lab
 double ySize
          The height of the rectangle which is actually displayed
 
Constructor Summary
mouseInfo(int colorScheme)
          Using the pixel size of the window, initializes all values to ensure that a square centered at (0,0) and with height 2*@see initialMinMax is visible.
mouseInfo(int colorScheme, int rows, int columns, int myrow, int mycolumn)
          Using the pixel size of the window, initializes all values to ensure that a square centered at (0,0) and with height 2*@see initialMinMax is visible.
 
Method Summary
 void abstractSize()
          Initialize dimensions to a standard size
 fundamentals.mouseInfo cloneMe()
          Return a clone of the present object
 void colorToPs(java.lang.StringBuffer work, int colorCode)
           
 double getIncoming(fundamentals.EuVector anchor, fundamentals.EuReal radius, int side)
          Describe getIncoming method here.
 double getOutgoing(fundamentals.EuVector anchor, fundamentals.EuReal radius, int side)
          Describe getOutgoing method here.
 int hashCode()
          Degenerate a hash code associated to the current dimensions.
 boolean onCanvas(double x, double y)
          Finds out whether a given mathematical point is currently visible on the canvas
 boolean onCanvas(fundamentals.EuVector point)
          Finds out whether a given mathematical point is currently visible on the canvas
 boolean pixelOnCanvas(int x, int y)
          Finds out whether a given pixel is inside the allotted canvas
 fundamentals.EuVector radiusAnchor()
          The mathematical position of the center of the quartercircles used to indicate radii.
 void recompute(java.awt.Dimension size)
          Using the existing pixel sizes, recalculates the values @see minSize,
 void resize()
          Using the existing pixel sizes, recalculates the values @see scale, @see x0 and @see y0 to ensure that a square centered at (x,y) and with sides of lenght @see minSize is visible.
 void resize(java.awt.Dimension size)
          Using the existing pixel sizes, recalculates the values @see scale, @see x0 and @see y0 to ensure that a square centered at (x,y) and with sides of lenght @see minSize is visible.
 boolean[] screenInside(fundamentals.EuVector anchor, fundamentals.EuReal radius)
          Generates a table determining whether or not the sides and cornes of the described screen are inside or outside the circle with passed center and radius.
 void setColor(java.awt.Graphics g, int colorCode)
          Returns color indicated by color code.
 java.lang.String toPs()
          Return a description in PostScript format of what portion of the screen is visible.
 void translate(int x, int y)
          Translate the visible screen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xCenter

public double xCenter
The x-value of the center of the square which must be displayed


yCenter

public double yCenter
The y-value of the center of the square which must be displayed


minSize

public double minSize
The side of the square which must be displayed


maxSize

public double maxSize
The longest side of the rectangle which is actually displayed


xSize

public double xSize
The width of the square being displayed


ySize

public double ySize
The height of the rectangle which is actually displayed


xAvailable

public int xAvailable
Number of pixels available on the x-axis


yAvailable

public int yAvailable
Number of pixels available on the y-axis


scale

public double scale
Object scaling; the lenght of a mathematical unit vector in pixels


x0

public int x0
Object offset; the first pixel coordinate of the (0,0) mathematical point


xCorner

public int xCorner
Leftmost pixel column used to display the current lab


y0

public int y0
Object offset; the second pixel coordinate of the (0,0) mathematical point


yCorner

public int yCorner
Topmost pixel row used to display the current lab


initialMinMax

public final double initialMinMax
Initial value, @see mouseInfo

See Also:
Constant Field Values

EAST

public static final int EAST
See Also:
Constant Field Values

NE

public static final int NE
See Also:
Constant Field Values

NORTH

public static final int NORTH
See Also:
Constant Field Values

NW

public static final int NW
See Also:
Constant Field Values

WEST

public static final int WEST
See Also:
Constant Field Values

SW

public static final int SW
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
See Also:
Constant Field Values

SE

public static final int SE
See Also:
Constant Field Values

BACKGROUND

public static final int BACKGROUND
Reference to the background color.

See Also:
Constant Field Values

BY_PREMISE

public static final int BY_PREMISE
Reference to the color used for objects given as premise.

See Also:
Constant Field Values

AS_TARGET

public static final int AS_TARGET
Reference to the color used for objects given as targets.

See Also:
Constant Field Values

CONSTRUCTED

public static final int CONSTRUCTED
Reference to the color used for constructed objects.

See Also:
Constant Field Values

SECONDARY

public static final int SECONDARY
Reference to the color used for recycled objects.

See Also:
Constant Field Values

CONSTRUCTED_TARGET

public static final int CONSTRUCTED_TARGET
Reference to the color used for self-constructed targets.

See Also:
Constant Field Values

SELECT

public static final int SELECT
Reference to the color used for selecting visible objects.

See Also:
Constant Field Values

SHADOW

public static final int SHADOW
Reference to the color of invisible objects.

See Also:
Constant Field Values

ERROR

public static final int ERROR
Reference to the color of dividers.

See Also:
Constant Field Values

DIVIDER

public static final int DIVIDER
Reference to the color of dividers.

See Also:
Constant Field Values

radiusCorner

public static int radiusCorner
The corner to use when drawing radii

Constructor Detail

mouseInfo

public mouseInfo(int colorScheme)
Using the pixel size of the window, initializes all values to ensure that a square centered at (0,0) and with height 2*@see initialMinMax is visible.

Parameters:
colorScheme - an int value

mouseInfo

public mouseInfo(int colorScheme,
                 int rows,
                 int columns,
                 int myrow,
                 int mycolumn)
Using the pixel size of the window, initializes all values to ensure that a square centered at (0,0) and with height 2*@see initialMinMax is visible.

Parameters:
colorScheme - an int value
rows - an int value
columns - an int value
myrow - an int value
mycolumn - an int value
Method Detail

resize

public void resize(java.awt.Dimension size)
Using the existing pixel sizes, recalculates the values @see scale, @see x0 and @see y0 to ensure that a square centered at (x,y) and with sides of lenght @see minSize is visible. Updates maxSize accordingly.

Parameters:
size - a Dimension value

resize

public void resize()
Using the existing pixel sizes, recalculates the values @see scale, @see x0 and @see y0 to ensure that a square centered at (x,y) and with sides of lenght @see minSize is visible. Updates maxSize accordingly.


abstractSize

public void abstractSize()
Initialize dimensions to a standard size


recompute

public void recompute(java.awt.Dimension size)
Using the existing pixel sizes, recalculates the values @see minSize,

Parameters:
size - a Dimension value
See Also:
and @see y0 to reflect a change in @see scale.

radiusAnchor

public fundamentals.EuVector radiusAnchor()
The mathematical position of the center of the quartercircles used to indicate radii.

Returns:
an EuVector value

pixelOnCanvas

public boolean pixelOnCanvas(int x,
                             int y)
Finds out whether a given pixel is inside the allotted canvas

Parameters:
x - first coordinate of the point in question
y - second coordinate of the point in question
Returns:
true if point on canvas

onCanvas

public boolean onCanvas(double x,
                        double y)
Finds out whether a given mathematical point is currently visible on the canvas

Parameters:
x - first coordinate of the point in question
y - second coordinate of the point in question
Returns:
true if point on canvas

onCanvas

public boolean onCanvas(fundamentals.EuVector point)
Finds out whether a given mathematical point is currently visible on the canvas

Parameters:
point - the point in question
Returns:
true if point on canvas

screenInside

public boolean[] screenInside(fundamentals.EuVector anchor,
                              fundamentals.EuReal radius)
Generates a table determining whether or not the sides and cornes of the described screen are inside or outside the circle with passed center and radius. Use with constants EAST,...,SE

Parameters:
anchor - an EuVector value
radius - an EuReal value
Returns:
a boolean[] value

getIncoming

public double getIncoming(fundamentals.EuVector anchor,
                          fundamentals.EuReal radius,
                          int side)
                   throws InternalException
Describe getIncoming method here.

Parameters:
anchor - an EuVector value
radius - an EuReal value
side - a constant EAST, NORTH, SOUTH or WEST.
Returns:
a double value
Throws:
InternalException - if an error occurs

getOutgoing

public double getOutgoing(fundamentals.EuVector anchor,
                          fundamentals.EuReal radius,
                          int side)
                   throws InternalException
Describe getOutgoing method here.

Parameters:
anchor - an EuVector value
radius - an EuReal value
side - a constant EAST, NORTH, SOUTH or WEST.
Returns:
a double value
Throws:
InternalException - if an error occurs

cloneMe

public fundamentals.mouseInfo cloneMe()
Return a clone of the present object

Returns:
a clone of the present object

translate

public void translate(int x,
                      int y)
Translate the visible screen

Parameters:
x - an int value
y - an int value

setColor

public void setColor(java.awt.Graphics g,
                     int colorCode)
Returns color indicated by color code.

Parameters:
g - an Object value
colorCode - an int value

colorToPs

public void colorToPs(java.lang.StringBuffer work,
                      int colorCode)

toPs

public java.lang.String toPs()
Return a description in PostScript format of what portion of the screen is visible.

Returns:
a String value

hashCode

public int hashCode()
Degenerate a hash code associated to the current dimensions. Used to determine when a complete reevaluation of visibility is needed.

Overrides:
hashCode in class java.lang.Object
Returns:
an int value