public final class ImageGraphicAttribute extends GraphicAttribute
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
getAlignment, getJustificationInfopublic 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 originpublic void draw(Graphics2D g, float x, float y)
draw in class GraphicAttributeg - - the graphics to use to render the imagex - - the x locationy - - the y locationpublic boolean equals(Object obj)
equals in class Objectobj - - the object to compareObject.hashCode()public boolean equals(ImageGraphicAttribute rhs)
rhs - - the ImageGraphicAttribute to comparepublic float getAdvance()
getAdvance in class GraphicAttributepublic float getAscent()
getAscent in class GraphicAttributepublic Rectangle2D getBounds()
getBounds in class GraphicAttributepublic float getDescent()
getDescent in class GraphicAttributepublic int hashCode()
hashCode in class ObjectObject.equals(Object),
System.identityHashCode(Object)