|
|||||||||
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.ImageGraphicAttribute
public final class ImageGraphicAttribute
This is an implementation of GraphicAttribute which draws images in a TextLayout.
Field Summary |
---|
Fields inherited from class java.awt.font.GraphicAttribute |
---|
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT |
Constructor Summary | |
---|---|
ImageGraphicAttribute(Image image,
int alignment)
Constucts an instance from the specified Image. |
|
ImageGraphicAttribute(Image image,
int alignment,
float originX,
float originY)
Constucts an instance from the specified Image. |
Method Summary | |
---|---|
void |
draw(Graphics2D g,
float x,
float y)
Draws the image at the specified location, relative to the origin. |
boolean |
equals(ImageGraphicAttribute rhs)
Compares this to the ImageGraphicAttribute given, by comparing all fields and values. |
boolean |
equals(Object obj)
Compares this to the specified Object |
float |
getAdvance()
Returns distance from the origin to the right edge of the image of this. |
float |
getAscent()
Returns the the distance from the top of the image to the origin of this. |
Rectangle2D |
getBounds()
Gets the bounds of the object rendered, relative to the position. |
float |
getDescent()
Returns the distance from the origin to the bottom of the image. |
int |
hashCode()
Gets the hash code for this image. |
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 |
Constructor Detail |
---|
public ImageGraphicAttribute(Image image, int alignment)
image
- - image to construct from.alignment
- - the alignmentpublic ImageGraphicAttribute(Image image, int alignment, float originX, float originY)
image
- - image to construct fromalignment
- - the alignmentoriginX
- - x point of originoriginY
- - y point of originMethod Detail |
---|
public void draw(Graphics2D g, float x, float y)
draw
in class GraphicAttribute
g
- - the graphics to use to render the imagex
- - the x locationy
- - the y locationpublic boolean equals(Object obj)
equals
in class Object
obj
- - the object to compare
Object.hashCode()
public boolean equals(ImageGraphicAttribute rhs)
rhs
- - the ImageGraphicAttribute to compare
public float getAdvance()
getAdvance
in class GraphicAttribute
public float getAscent()
getAscent
in class GraphicAttribute
public Rectangle2D getBounds()
getBounds
in class GraphicAttribute
public float getDescent()
getDescent
in class GraphicAttribute
public int hashCode()
hashCode
in class Object
Object.equals(Object)
,
System.identityHashCode(Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |