ecologylab.generic
Class Line2D
java.lang.Object
ecologylab.generic.Line2D
public class Line2D
- extends java.lang.Object
A 2D line, as defined by parametric coefficients.
The line, ultimately will be defined by 2 end points, that is, by 4
integers, when it is drawn.
The parametric representation is of the form:
x0 = a*x + b*width + c,
y0 = a*y + b*height + c.
Displacement1D holds these parametric forms.
In our world a=1, always, so we assume that, and dont bother with
the extra multiplication. (This could always be changed inside the
encapsulated Displacement1D, without effecting the call sites.)
|
Constructor Summary |
Line2D(int[] dx0)
|
Line2D(int[] dx0,
int[] dy0,
int[] dx1,
int[] dy1)
|
Line2D(int dxb0,
int dxc0,
int dyb0,
int dyc0,
int dxb1,
int dxc1,
int dyb1,
int dyc1)
|
|
Method Summary |
void |
draw(java.awt.Graphics g,
int x,
int y,
int width,
int height)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Line2D
public Line2D(int[] dx0,
int[] dy0,
int[] dx1,
int[] dy1)
Line2D
public Line2D(int[] dx0)
Line2D
public Line2D(int dxb0,
int dxc0,
int dyb0,
int dyc0,
int dxb1,
int dxc1,
int dyb1,
int dyc1)
draw
public void draw(java.awt.Graphics g,
int x,
int y,
int width,
int height)