|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectComplDemo.ComplexWrapper
public class ComplDemo.ComplexWrapper
Wrapper for Complex with pixel coordinates and comparison.
An oOject of this class wraps a Complex object, adapts it to the
interface Comparable and adds pixel coordinates and painting in
a specified colour
Hint: A ComplDemo object makes just three such wrappers: two for
operands and one for the result.
| Field Summary | |
|---|---|
Color |
color
Painting colour for the complex vector. |
Complex |
cp
The complex number wrapped. |
int |
lp
Pixel norm. |
boolean |
noShow
Do not paint. |
byte |
stat
State. |
int |
xp
Pixel coordinates. |
int |
yp
Pixel coordinates. |
| Constructor Summary | |
|---|---|
ComplDemo.ComplexWrapper(Color color)
Make a wrapper. |
|
| Method Summary | |
|---|---|
int |
compareTo(ComplDemo.ComplexWrapper other)
Compare the absolute values. |
void |
consist()
Make pixel and complex values consistent. |
void |
doThePaint(Graphics g)
Paint as vector. |
void |
set(Complex cp)
Set the Complex. |
void |
set(double re,
double im)
Set by real and imaginary part. |
void |
set(int xp,
int yp)
Set by pixel coordinates x, y. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Complex cp
public Color color
public int xp
public int yp
public int lp
public byte stat
cp and (xp, yp}.
public boolean noShow
doThePaint(Graphics) does nothing.
| Constructor Detail |
|---|
public ComplDemo.ComplexWrapper(Color color)
color - the colour for painting the vector (never null!).| Method Detail |
|---|
public void set(Complex cp)
public void set(double re,
double im)
public void set(int xp,
int yp)
public void consist()
public int compareTo(ComplDemo.ComplexWrapper other)
Comparable implementation.
compareTo in interface Comparable<ComplDemo.ComplexWrapper>public void doThePaint(Graphics g)
g
must be the coordinates origin in the complex plane.noShow is true, nothing will be done.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||