|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdrawing.graphics.GraphicsOperation org.jdrawing.graphics.DrawLine
Graphics element which corresponds to Graphics.drawLine(int, int, int, int)
Constructor Summary | |
DrawLine(int x1,
int y1,
int x2,
int y2)
Returns DrawLine for line starting at (x1, y1) and ending at (x2, y2). |
|
DrawLine(int x1,
int y1,
int x2,
int y2,
Style style)
Returns DrawLine for line starting at (x1, y1) and ending at (x2, y2). |
Method Summary | |
java.awt.Rectangle |
getBounds()
Returns bounding box of the element. |
java.awt.geom.Rectangle2D |
getBounds2D()
Returns high precision bounding box of the element. |
java.awt.Shape |
getShapeOfOperation()
Returns shape of the area updated by this operation. |
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 drawing 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 |
contains, getPosition, getStyle, paint, setPosition, setStyle |
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 y1, int x2, int y2)
public DrawLine(int x1, int y1, int x2, int y2, Style style)
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()
getBounds
in interface DrawingElement
getBounds
in class GraphicsOperation
public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface DrawingElement
getBounds2D
in class GraphicsOperation
public boolean intersects(java.awt.geom.Rectangle2D rectangle)
intersects
in interface DrawingElement
intersects
in class GraphicsOperation
rectangle
- rectangle to be checked for intersection
public java.awt.Shape getShapeOfOperation()
getShapeOfOperation
in class GraphicsOperation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |