|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object extended bydiva.util.java2d.AbstractPaintedGraphic extended bydiva.util.java2d.PaintedShape
A utility class that paints a shape with an stroke and/or fill. This class is intended for use as a low-level class to simplify construction of drawn graphics. It contains a number of fields that govern how the shape is painted, such as the fill paint, stroke stroke or line width, and stroke paint.
| Field Summary | |
java.awt.Paint |
fillPaint
The paint for the fill. |
| Fields inherited from class diva.util.java2d.AbstractPaintedGraphic |
shape, stroke, strokePaint |
| Constructor Summary | |
PaintedShape(java.awt.Shape shape)
Create a painted shape on the given Shape. |
|
PaintedShape(java.awt.Shape shape,
float lineWidth)
Create a painted shape on the given Shape. |
|
PaintedShape(java.awt.Shape shape,
float lineWidth,
java.awt.Paint strokePaint)
Create a painted shape on the given Shape. |
|
PaintedShape(java.awt.Shape shape,
java.awt.Paint fillPaint)
Create a painted shape on the given Shape. |
|
PaintedShape(java.awt.Shape shape,
java.awt.Paint fillPaint,
float lineWidth)
Create a painted shape on the given Shape. |
|
PaintedShape(java.awt.Shape shape,
java.awt.Paint fillPaint,
float lineWidth,
java.awt.Paint strokePaint)
Create a painted shape on the given Shape. |
|
| Method Summary | |
float |
getLineWidth()
Get the line width |
boolean |
hit(java.awt.geom.Rectangle2D r)
Test if this shape is hit by the given rectangle. |
boolean |
intersects(java.awt.geom.Rectangle2D r)
Test if this shape intersects the given rectangle. |
void |
paint(java.awt.Graphics2D g)
Paint the shape. |
void |
setFillPaint(java.awt.Paint fillPaint)
Set the fill paint for this shape (its fill if it is closed). |
void |
setLineWidth(float lineWidth)
Set the line width. |
void |
setStrokePaint(java.awt.Paint strokePaint)
Set the stroke paint for this shape (its outline if it is closed). |
| Methods inherited from class diva.util.java2d.AbstractPaintedGraphic |
getBounds, getStroke, getStroke, getStroke |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public java.awt.Paint fillPaint
| Constructor Detail |
public PaintedShape(java.awt.Shape shape)
public PaintedShape(java.awt.Shape shape, java.awt.Paint fillPaint)
public PaintedShape(java.awt.Shape shape, float lineWidth)
public PaintedShape(java.awt.Shape shape, java.awt.Paint fillPaint, float lineWidth)
public PaintedShape(java.awt.Shape shape, float lineWidth, java.awt.Paint strokePaint)
public PaintedShape(java.awt.Shape shape, java.awt.Paint fillPaint, float lineWidth, java.awt.Paint strokePaint)
| Method Detail |
public float getLineWidth()
getLineWidth in interface PaintedGraphicgetLineWidth in class AbstractPaintedGraphicpublic boolean hit(java.awt.geom.Rectangle2D r)
hit in interface PaintedGraphichit in class AbstractPaintedGraphicpublic boolean intersects(java.awt.geom.Rectangle2D r)
public void paint(java.awt.Graphics2D g)
public void setLineWidth(float lineWidth)
setLineWidth in interface PaintedGraphicsetLineWidth in class AbstractPaintedGraphicpublic void setStrokePaint(java.awt.Paint strokePaint)
public void setFillPaint(java.awt.Paint fillPaint)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||