|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Provides definitions for objects that can be displayed
in the Graphics2D context. When an object
implementing the Shapable inteface is displayed,
the methods are used followingly:
For further information on theGraphics2D g2;...
Shapable s;
if (s.isFilled()) {
g2.setPaint(s.paint());
g2.fill(s.shape());
}
if (s.isDrawn()) {
g2.setPaint(s.color());
g2.setStroke(s.stroke());
g2.draw(s.shape());
}
Graphics2D class,
see the trail
"2D Graphics" in The Java Tutorial.
Graphics2D| Method Summary | |
java.awt.Color |
color()
Returns a Color object that is used for drawing
the outline. |
boolean |
isDrawn()
Returns a boolean value indicating whether the outline of the shape is drawn or not. |
boolean |
isFilled()
Returns a boolean value indicating whether the shape is filled or not. |
java.awt.Paint |
paint()
Returns a Paint object that is used for filling
the shape. |
java.awt.Shape |
shape()
Returns a Shape object that defines the appearance
of the object. |
java.awt.Stroke |
stroke()
Returns a Stroke object that is used for drawing
the outline. |
| Method Detail |
public java.awt.Shape shape()
Shape object that defines the appearance
of the object.
Shapepublic boolean isDrawn()
stroke(),
color()public java.awt.Stroke stroke()
Stroke object that is used for drawing
the outline.
isDrawn(),
Strokepublic java.awt.Color color()
Color object that is used for drawing
the outline.
isDrawn(),
Colorpublic boolean isFilled()
paint()public java.awt.Paint paint()
Paint object that is used for filling
the shape.
isFilled(),
Paint
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||