|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.font.GraphicAttribute
java.awt.font.ShapeGraphicAttribute
public final class ShapeGraphicAttribute
This is an implementation of GraphicAttribute that draws shapes in a TextLayout.
| Field Summary | |
|---|---|
static boolean |
FILL
True if the shape should be filled. |
static boolean |
STROKE
True if the shape should be stroked with a 1-pixel wide stroke. |
| Fields inherited from class java.awt.font.GraphicAttribute |
|---|
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT |
| Constructor Summary | |
|---|---|
ShapeGraphicAttribute(Shape shape,
int alignment,
boolean stroke)
Constructor. |
|
| Method Summary | |
|---|---|
void |
draw(Graphics2D graphics,
float x,
float y)
Draws the graphic at the given location. |
boolean |
equals(Object obj)
Compares this ShapeGraphicAttribute to obj. |
boolean |
equals(ShapeGraphicAttribute rhs)
Compares this ShapeGraphicAttribute to rhs. |
float |
getAdvance()
Gets the distance from the origin of its Shape to the right side of the bounds of its Shape. |
float |
getAscent()
Gets the positive distance from the origin of its Shape to the top of bounds. |
Rectangle2D |
getBounds()
Returns a Rectangle2D that encloses all of the bits drawn by this shape. |
float |
getDescent()
Gets the distance from the origin of its Shape to the bottom of the bounds. |
int |
hashCode()
Gets the hash code. |
| Methods inherited from class java.awt.font.GraphicAttribute |
|---|
getAlignment, getJustificationInfo |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean FILL
public static final boolean STROKE
| Constructor Detail |
|---|
public ShapeGraphicAttribute(Shape shape,
int alignment,
boolean stroke)
shape - - the Shape to render. The Shape is rendered with its origin.alignment - - the alignmentstroke - - true if the Shape should be stroked; false if the Shape
should be filled.| Method Detail |
|---|
public void draw(Graphics2D graphics,
float x,
float y)
draw in class GraphicAttributegraphics - - the graphics to use.x - - the x location to draw at.y - - the y location to draw at.public boolean equals(Object obj)
equals in class Objectobj - - the object to compare.
Object.hashCode()public boolean equals(ShapeGraphicAttribute rhs)
rhs - - the ShapeGraphicAttribute to compare.public float getAdvance()
getAdvance in class GraphicAttributepublic float getAscent()
getAscent in class GraphicAttributepublic float getDescent()
getDescent in class GraphicAttributepublic Rectangle2D getBounds()
getBounds in class GraphicAttributepublic int hashCode()
hashCode in class ObjectObject.equals(Object),
System.identityHashCode(Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||