|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jdrawing.graphics.GraphicsOperation
This is the base class for all elements, representing drawing operations.
Constructor Summary | |
GraphicsOperation()
Constructs GraphicsOperation with default style. |
|
GraphicsOperation(Style style)
Constructs GraphicsOperation with given style. |
Method Summary | |
boolean |
contains(java.awt.geom.Point2D point)
Tests if the element contains a 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 |
getPosition()
Returns the position of this operation in the painting sequence of the model. |
abstract java.awt.Shape |
getShapeOfOperation()
Returns shape of the area updated by this operation. |
Style |
getStyle()
Gets Style object encapsulating style attibutes of this
operation. |
boolean |
intersects(java.awt.geom.Rectangle2D rectangle)
Tests if the element intersects with the given rectangle. |
void |
paint(java.awt.Graphics graphics)
Paint the element. |
abstract void |
paintOperation(java.awt.Graphics2D graphics)
Performs drawing operation. |
void |
setPosition(int position)
Stores the position of this operation in the painting sequence of the model. |
void |
setStyle(Style style)
Sets Style object encapsulating style attibutes of this
operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GraphicsOperation()
GraphicsOperation
with default style.
public GraphicsOperation(Style style)
GraphicsOperation
with given style.
style
- the style for this graphics operationMethod Detail |
public void setPosition(int position)
position
- new position valuepublic int getPosition()
public void setStyle(Style style)
Style
object encapsulating style attibutes of this
operation.
style
- the Style
objectpublic Style getStyle()
Style
object encapsulating style attibutes of this
operation.
Style
objectpublic void paint(java.awt.Graphics graphics)
paintOperation(java.awt.Graphics2D)
.
paint
in interface DrawingElement
graphics
- graphics context to use for paintingpublic abstract void paintOperation(java.awt.Graphics2D graphics)
graphics
- graphics context to use for paintingpublic abstract java.awt.Shape getShapeOfOperation()
public java.awt.Rectangle getBounds()
getShapeOfOperation()
.
getBounds
in interface DrawingElement
public java.awt.geom.Rectangle2D getBounds2D()
getShapeOfOperation()
.
getBounds2D
in interface DrawingElement
public boolean intersects(java.awt.geom.Rectangle2D rectangle)
getShapeOfOperation()
for intersection.
intersects
in interface DrawingElement
rectangle
- rectangle to be checked for intersection
public boolean contains(java.awt.geom.Point2D point)
getShapeOfOperation()
if it contains given point.
contains
in interface DrawingElement
point
- to be checked
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |