All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class objects.EuLine

java.lang.Object
   |
   +----objects.EuObject
           |
           +----objects.EuPoint
                   |
                   +----objects.EuLine

public class EuLine
extends EuPoint
An instance of this class represents a line, represented as two cartesian pairs.


Variable Index

 o generator
A generating vector of the line.

Constructor Index

 o EuLine(double, double, double, double)
The constructor does initialization.

Method Index

 o atParameter(double)
Return in a
 o castIdentical(EuObject)
See if passed object can be cast to the present one.
 o closestParameter(double, double)
Find the parameter value which yields the closest point to a given one.
 o closestParameter(EuVector)
 o closureContains(EuVector)
See if passed point lies on the line.
 o draw(Graphics, mouseInfo)
Draw the line, using the
 o drawTheLine(Graphics, mouseVector, mouseVector)
 o interiorContains(EuVector)
See if passed point lies on the line.
 o matchingPair(EuVector, EuVector, EuVector, EuVector)
 o MouseVicinity(mouseVector, mouseInfo)
See if mouse position is close to this line.
 o myFullShadow()
 o overlaps(EuObject)
Acts identically to
 o setShadow(int)
Sets the
 o subType()
 o type()

Variables

 o generator
 public EuVector generator
A generating vector of the line. Is normalized to be a unit vector.

Constructors

 o EuLine
 public EuLine(double x,
               double y,
               double deltax,
               double deltay) throws LeaRuntimeException
The constructor does initialization. A zero generator vector gives a LeaRuntimeException

Parameters:
x - the first coordinate of anchor
y - the second coordinate of anchor
deltax - the first coordinate of generator
deltay - the second coordinate of generator

Methods

 o atParameter
 public EuWorkVector atParameter(double t)
Return in a @see EuWorkVector the coordinates of a point on the line at a given generator.

Parameters:
t - the parameter
Returns:
the coordinates
Overrides:
atParameter in class EuPoint
 o closestParameter
 protected double closestParameter(double x,
                                   double y)
Find the parameter value which yields the closest point to a given one.

Parameters:
x - The first coordinate of the given point
y - The second coordinate of the given point
Returns:
The parameter
 o closestParameter
 protected double closestParameter(EuVector v)
 o drawTheLine
 protected void drawTheLine(Graphics g,
                            mouseVector pointA,
                            mouseVector pointB)
 o draw
 public void draw(Graphics g,
                  mouseInfo info)
Draw the line, using the @see mouseInfo for scaling and positioning.

Parameters:
g - the Graphics handle on the window
info - information used in positioning the object
Overrides:
draw in class EuPoint
 o castIdentical
 public boolean castIdentical(EuObject other)
See if passed object can be cast to the present one.

Parameters:
other - the object being compared to the present one
Returns:
true if passed object is a @see EuLine, @see EuHalf or @see EuInterval which is a subset of this one
Overrides:
castIdentical in class EuPoint
 o MouseVicinity
 public boolean MouseVicinity(mouseVector mouseAt,
                              mouseInfo info)
See if mouse position is close to this line.

Parameters:
mouseAt - The coordinates of the mouse position
info - information used in locating the object on screen
Returns:
true if the mouse is close to the line.
 o overlaps
 public boolean overlaps(EuObject other)
Acts identically to @see castIdentical()

Parameters:
other - the object being compared to the present one
Returns:
true if passed object is a @see EuLine, @see EuHalf or @see EuInterval which is a subset of this one
Overrides:
overlaps in class EuPoint
 o interiorContains
 public boolean interiorContains(EuVector point)
See if passed point lies on the line.

Parameters:
point - the point being compared to the present line
Returns:
true if passed point lies on the line.
Overrides:
interiorContains in class EuPoint
 o closureContains
 public boolean closureContains(EuVector point)
See if passed point lies on the line.

Parameters:
point - the point being compared to the present line
Returns:
true if passed point lies on the line.
Overrides:
closureContains in class EuPoint
 o type
 public int type()
Returns:
@see LINE
Overrides:
type in class EuPoint
 o subType
 public int subType()
Returns:
@see A_LINE
Overrides:
subType in class EuPoint
 o myFullShadow
 public int myFullShadow()
Returns:
-1 as this object is full.
Overrides:
myFullShadow in class EuPoint
 o matchingPair
 protected boolean matchingPair(EuVector a,
                                EuVector b,
                                EuVector c,
                                EuVector d)
Overrides:
matchingPair in class EuPoint
 o setShadow
 public void setShadow(int i)
Sets the @see EuLab number of the full object behind the present one.

Returns:
i the EuLab index (ignored)
Overrides:
setShadow in class EuPoint

All Packages  Class Hierarchy  This Package  Previous  Next  Index