|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.font.GraphicAttribute
This represents a graphic embedded in text. Clients subclass this to implement their own char replacement graphics. Clients wishing to embed Shapes and Images in text need not subclass this class; they can use the ShapeGraphicAttribute and ImageGraphicAttribute classes instead.
Subclasses should ensure that their subclasses are immutable (that is, that the class does not change once it has been constructed). Mutating a GraphicAttribute which is used in a TextLayout results in undefined behavior from the TextLayout.
Field Summary | |
static int | BOTTOM_ALIGNMENT
Align bottom of graphic to bottom of line. |
static int | CENTER_BASELINE
Align origin of graphic to center baseline of line. |
static int | HANGING_BASELINE
Align origin of graphic to hanging baseline of line. |
static int | ROMAN_BASELINE
Align origin of graphic to roman baseline of line. |
static int | TOP_ALIGNMENT
Align top of graphic to top of line. |
Constructor Summary | |
GraphicAttribute(int alignment)
Construct a graphic attribute. |
Method Summary | |
abstract void | draw(Graphics2D graphics,
float x,
float y)
Draw the graphic at the given location. |
abstract float | getAdvance()
Return the advance of this graphic. |
int | getAlignment()
Return the alignment of this graphic. |
abstract float | getAscent()
Return the ascent of this graphic. |
Rectangle2D | getBounds()
Returns a rectangle which encloses all of the bits drawn by this graphic (relative to the drawing position, of course). |
abstract float | getDescent()
Return the descent of this graphic. |
GlyphJustificationInfo | getJustificationInfo()
Return the justification information for this graphic. |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
Field Detail |
public static final int TOP_ALIGNMENT
public static final int BOTTOM_ALIGNMENT
public static final int ROMAN_BASELINE
public static final int CENTER_BASELINE
public static final int HANGING_BASELINE
Constructor Detail |
protected GraphicAttribute(int alignment)
Method Detail |
public abstract float getAscent()
public abstract float getDescent()
public abstract float getAdvance()
public Rectangle2D getBounds()
public abstract void draw(Graphics2D graphics, float x, float y)
graphics
- the Graphics2D into which to draw the graphic
x
- the x-coordinate (in user space) where the graphic is drawn
y
- the y-coordinate (in user space) where the graphic is drawnpublic final int getAlignment()
public GlyphJustificationInfo getJustificationInfo()
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |