java.lang.Object computational.geometry.meshgeneration.MyPoint
public class MyPoint
Constructor Summary | |
---|---|
MyPoint()
|
|
MyPoint(int x,
int y)
|
|
MyPoint(MyPoint P)
|
Method Summary | |
---|---|
int |
compareTo(java.lang.Object a)
|
boolean |
contains(Point p)
Tells whether the shape encloses a given point. |
void |
draw(java.awt.Graphics gfx)
Draws the shape, using the current graphics context's color. |
void |
drawLabels(java.awt.Graphics gfx)
Draws the shape's associated labels, using the graphics context's color. |
void |
drawPoints(java.awt.Graphics gfx)
Draws the shape's defining points, using the graphics context's color. |
java.lang.String |
getLabel()
Returns the text label associated to this shape. |
java.util.List |
getPoints()
Returns a list containing copies of the shape's defining points. |
int |
getx()
|
int |
gety()
|
void |
setLabel(java.lang.String label)
Associates this shape with a given text label. |
void |
setx(int x)
|
void |
sety(int y)
|
void |
translate(int dx,
int dy)
Translates the shape by the given amount. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MyPoint()
public MyPoint(int x, int y)
public MyPoint(MyPoint P)
Method Detail |
---|
public int compareTo(java.lang.Object a)
public boolean contains(Point p)
Shape
contains
in interface Shape
p
- the point we test for encloseness.
public void draw(java.awt.Graphics gfx)
Shape
draw
in interface Shape
gfx
- the graphics context where this shape has to be drawn.public void drawLabels(java.awt.Graphics gfx)
Shape
drawLabels
in interface Shape
gfx
- the graphics context where this shape's labels have
to be drawn.public void drawPoints(java.awt.Graphics gfx)
Shape
drawPoints
in interface Shape
gfx
- the graphics context where this shape's points have
to be drawn.public java.lang.String getLabel()
Shape
getLabel
in interface Shape
public java.util.List getPoints()
Shape
getPoints
in interface Shape
public int getx()
public int gety()
public void setLabel(java.lang.String label)
Shape
setLabel
in interface Shape
label
- the shape's new label.public void setx(int x)
public void sety(int y)
public void translate(int dx, int dy)
Shape
translate
in interface Shape
dx
- the amount to translate along the X-axis