|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectNGP.Graphics.Shape
NGP.Graphics.Line
A Line is a Shape composed of two endpoints. Right now, it doesn't react, or wrap for that matter like Shapes do. It has some of its own methods that are line specific.
| Field Summary |
| Fields inherited from class NGP.Graphics.Shape |
_awtShape, _dpanel |
| Fields inherited from interface NGP.Colorable |
DEFAULT_GRAY |
| Constructor Summary | |
Line(DrawingPanel dp)
Create a line with the given DrawingPanel |
|
| Method Summary | |
void |
actualPaint(Graphics2D g)
Normal users need not use this! |
Rectangle |
getBounds()
Return the bounding rectangle. |
Point |
getP1()
Gets the first endpoint |
Point |
getP2()
Gets the second endpoint |
float |
getThickness()
Get the thickness of the Line |
void |
react()
Lines cannot react. |
void |
setPoints(Point p1,
Point p2)
Set the endpoints for this Line. |
void |
setThickness(float thickness)
Set the thickness of the Line |
| Methods inherited from class NGP.Graphics.Shape |
contains, drag, getCenterLocation, getColor, getDrawingPanel, getRotation, hide, intersects, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, setColor, setDrawingPanel, setRotation, show |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Line(DrawingPanel dp)
dp - the DrawingPanel for this Line| Method Detail |
public void setPoints(Point p1,
Point p2)
p1 - the first Pointp2 - the second Pointpublic Point getP1()
public Point getP2()
public void setThickness(float thickness)
thickness - the float (you might need to cast) representing the
thicknesspublic float getThickness()
public void actualPaint(Graphics2D g)
Play with the stroke and paint the line.
actualPaint in class Shapepublic Rectangle getBounds()
getBounds in interface GraphicgetBounds in class Shapepublic final void react()
react in interface Reactorreact in class Shape
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||