fundamentals
Class mouseVector

java.lang.Object
  |
  +--fundamentals.mouseVector

public class mouseVector
extends java.lang.Object


Field Summary
static int MouseTolerance
          The number of pixels determining the maximal allowed distance between a mouse position and an object, under which they can be considered close.
 int x
          The first coordinate
 int y
          The second coordinate
 
Constructor Summary
mouseVector(fundamentals.EuVector v, fundamentals.mouseInfo info)
           
mouseVector(int x, int y)
           
 
Method Summary
 boolean close(fundamentals.mouseVector other)
          Determines whether another vector is 'close enough'
 boolean distanceIs(fundamentals.mouseVector other, int d)
          Determines whether another vector is 'close enough' to having a specific distance from the present one
 boolean parallel(fundamentals.EuVector other)
          Determines whether another vector is 'close enough' to being parallel
 void subtract(fundamentals.mouseVector v)
          Subtracts another mouseVector from the present one
 fundamentals.EuVector toMath(fundamentals.mouseInfo info)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MouseTolerance

public static final int MouseTolerance
The number of pixels determining the maximal allowed distance between a mouse position and an object, under which they can be considered close.

See Also:
Constant Field Values

x

public int x
The first coordinate


y

public int y
The second coordinate

Constructor Detail

mouseVector

public mouseVector(int x,
                   int y)
Parameters:
x - the first coordinate
y - the second coordinate

mouseVector

public mouseVector(fundamentals.EuVector v,
                   fundamentals.mouseInfo info)
Parameters:
v - a mathematical representation of the vector
info - the information needed to transform it into a canvas vector
Method Detail

close

public boolean close(fundamentals.mouseVector other)
Determines whether another vector is 'close enough'

Parameters:
other - the mouseVector being compared to the present one
Returns:
true if they are close

parallel

public boolean parallel(fundamentals.EuVector other)
Determines whether another vector is 'close enough' to being parallel

Parameters:
other - the mouseVector being compared to the present one
Returns:
true if they are parallel

distanceIs

public boolean distanceIs(fundamentals.mouseVector other,
                          int d)
Determines whether another vector is 'close enough' to having a specific distance from the present one

Parameters:
other - the mouseVector being compared to the present one
d - the distance
Returns:
true if the distance is as specified

subtract

public void subtract(fundamentals.mouseVector v)
Subtracts another mouseVector from the present one

Parameters:
v - the subtracted vector

toMath

public fundamentals.EuVector toMath(fundamentals.mouseInfo info)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object