| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 | |
|  boolean | equals(java.lang.Object object)Checks whether two draw line operations are equal. | 
|  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. | 
|  int | hashCode()Returns the hashcode for this draw line operation. | 
|  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, finalize, getClass, 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 point
public void setEnd(int x,
                   int y)
x - the x coordinate of the end pointy - the y coordinate of the end point
public 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 GraphicsOperationgraphics - graphics context to use for paintingpublic java.awt.Rectangle getBounds()
getBounds in interface DrawingElementgetBounds in class GraphicsOperationpublic java.awt.geom.Rectangle2D getBounds2D()
getBounds2D in interface DrawingElementgetBounds2D in class GraphicsOperationpublic boolean intersects(java.awt.geom.Rectangle2D rectangle)
intersects in interface DrawingElementintersects in class GraphicsOperationrectangle - rectangle to be checked for intersection
public java.awt.Shape getShapeOfOperation()
getShapeOfOperation in class GraphicsOperationpublic boolean equals(java.lang.Object object)
true if and only if the 
 argument is not null and is a 
 DrawLine object that has the 
 same attributes as this DrawLine.
equals in class GraphicsOperationobject - the Object to compare with
               this DrawLine
true if the objects are equal; 
         false otherwise.public int hashCode()
hashCode in class GraphicsOperation| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||