|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdrawing.graphics.GraphicsElement org.jdrawing.graphics.GraphicsOperation org.jdrawing.graphics.DrawLine
Graphics element which corresponds to Graphics.drawLine(int, int, int, int)
Field Summary |
Fields inherited from class org.jdrawing.graphics.GraphicsElement |
BACKGROUND, COLOR, COMPOSITE, FONT, PAINT, parent, position, STROKE, TRANSFORM |
Constructor Summary | |
DrawLine(int x1,
int x2,
int y1,
int y2)
Returns DrawLine for line starting at (x1, y1) and ending at (x2, y2). |
Method Summary | |
boolean |
contains(java.awt.geom.Point2D point)
Tests if the element containes given point. |
java.awt.Rectangle |
getBounds()
Returns bounding box of the element. |
java.awt.geom.Rectangle2D |
getBounds2D()
Returns high precision bounding box of the element. |
int |
getX1()
Returns X coordinate of start point of the line. |
int |
getX2()
Returns X coordinate of end point of the line. |
int |
getY1()
Returns Y coordinate of start point of the line. |
int |
getY2()
Returns Y coordinate of end point of the line. |
boolean |
intersects(java.awt.geom.Rectangle2D rectangle)
Tests if the element intersects with the given rectangle. |
void |
paintOperation(java.awt.Graphics2D graphics)
Performs grawing operation. |
void |
setBegin(int x,
int y)
Sets begin point for this line. |
void |
setEnd(int x,
int y)
Sets end point for this line. |
void |
setLine(int x1,
int y1,
int x2,
int y2)
Sets begin and end points for this line. |
void |
setX1(int x1)
Sets X coordinate of start point of the line. |
void |
setX2(int x2)
Sets X coordinate of end point of the line. |
void |
setY1(int y1)
Sets Y coordinate of start point of the line. |
void |
setY2(int y2)
Sets Y coordinate of end point of the line. |
Methods inherited from class org.jdrawing.graphics.GraphicsOperation |
paint, update |
Methods inherited from class org.jdrawing.graphics.GraphicsElement |
addStyle, getParent, getStyle, getStyles, getTransform |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DrawLine(int x1, int x2, int y1, int y2)
Method Detail |
public void setX1(int x1)
x1
- the x coordinatepublic int getX1()
public void setX2(int x2)
x2
- the x coordinatepublic int getX2()
public void setY1(int y1)
y1
- the y coordinatepublic int getY1()
public void setY2(int y2)
y2
- the y coordinatepublic int getY2()
public void setBegin(int x, int y)
x
- the x coordinate of the begin pointy
- the y coordinate of the begin pointpublic void setEnd(int x, int y)
x
- the x coordinate of the end pointy
- the y coordinate of the end pointpublic void setLine(int x1, int y1, int x2, int y2)
x1
- the x coordinate of the begin pointy1
- the y coordinate of the begin pointx2
- the x coordinate of the end pointy2
- the y coordinate of the end pointpublic void paintOperation(java.awt.Graphics2D graphics)
graphics.drawLine ()
.
paintOperation
in class GraphicsOperation
graphics
- graphics context to use for paintingpublic java.awt.Rectangle getBounds()
public java.awt.geom.Rectangle2D getBounds2D()
public boolean intersects(java.awt.geom.Rectangle2D rectangle)
rectangle
- rectangle to be cheched for intersection
public boolean contains(java.awt.geom.Point2D point)
point
- to be checked
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |