This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.awt.font
class ImageGraphicAttribute

java.lang.Object extended by java.awt.font.GraphicAttribute extended by java.awt.font.ImageGraphicAttribute

public final class ImageGraphicAttribute
extends GraphicAttribute

The ImageGraphicAttribute class is an implementation of {@link GraphicAttribute} which draws images in a {@link 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 ImageGraphicAttribute from the specified java.awt.Image.
ImageGraphicAttribute(Image image, int alignment, float originX, float originY)

          Constructs an ImageGraphicAttribute from the specified Image.
 
Method Summary
 void
draw(Graphics2D graphics, float x, float y)

          Renders this GraphicAttribute at the specified location.
 boolean

          Compares this ImageGraphicAttribute to the specified ImageGraphicAttribute.
 boolean

          Compares this ImageGraphicAttribute to the specified java.lang.Object.
 float

          Returns the advance of this ImageGraphicAttribute.
 float

          Returns the ascent of this ImageGraphicAttribute.
 Rectangle2D

          Returns a java.awt.geom.Rectangle2D that encloses all of the bits rendered by this ImageGraphicAttribute, relative to the rendering position.
 float

          Returns the descent of this ImageGraphicAttribute.
 int

          Returns a hashcode for this ImageGraphicAttribute.
 
Methods inherited from class java.awt.font.GraphicAttribute
draw, getAdvance, getAlignment, getAscent, getBounds, getDescent, getJustificationInfo, getOutline
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageGraphicAttribute

public ImageGraphicAttribute(Image image,
                             int alignment)
Constucts an ImageGraphicAttribute from the specified {@link Image}. The origin is at (0, 0).

Parameters:
image - the Image rendered by this ImageGraphicAttribute. This object keeps a reference to image.
alignment - one of the alignments from this ImageGraphicAttribute

ImageGraphicAttribute

public ImageGraphicAttribute(Image image,
                             int alignment,
                             float originX,
                             float originY)
Constructs an ImageGraphicAttribute from the specified Image. The point (originXoriginY) in the Image appears at the origin of the ImageGraphicAttribute within the text.

Parameters:
image - the Image rendered by this ImageGraphicAttribute. This object keeps a reference to image.
alignment - one of the alignments from this ImageGraphicAttribute
originX - the X coordinate of the point within the Image that appears at the origin of the ImageGraphicAttribute in the text line.
originY - the Y coordinate of the point within the Image that appears at the origin of the ImageGraphicAttribute in the text line.
Method Detail

draw

public void draw(Graphics2D graphics,
                 float x,
                 float y)
{@inheritDoc}

Overrides:
draw in class GraphicAttribute
Parameters:
graphics
x
y

equals

public boolean equals(ImageGraphicAttribute rhs)
Compares this ImageGraphicAttribute to the specified ImageGraphicAttribute.

Parameters:
rhs - the ImageGraphicAttribute to compare for equality
Returns:
true if this ImageGraphicAttribute equals rhs; false otherwise.

equals

public boolean equals(Object rhs)
Compares this ImageGraphicAttribute to the specified {@link Object}.

Overrides:
equals in class Object
Parameters:
rhs - the Object to compare for equality
Returns:
true if this ImageGraphicAttribute equals rhs; false otherwise.

getAdvance

public float getAdvance()
Returns the advance of this ImageGraphicAttribute. The advance of an ImageGraphicAttribute is the distance from the origin to the right edge of the image.

Overrides:
getAdvance in class GraphicAttribute
Returns:
the advance of this ImageGraphicAttribute.

getAscent

public float getAscent()
Returns the ascent of this ImageGraphicAttribute. The ascent of an ImageGraphicAttribute is the distance from the top of the image to the origin.

Overrides:
getAscent in class GraphicAttribute
Returns:
the ascent of this ImageGraphicAttribute.

getBounds

public Rectangle2D getBounds()
Returns a {@link Rectangle2D} that encloses all of the bits rendered by this ImageGraphicAttribute, relative to the rendering position. A graphic can be rendered beyond its origin, ascent, descent, or advance; but if it is, this method's implementation must indicate where the graphic is rendered.

Overrides:
getBounds in class GraphicAttribute
Returns:
a Rectangle2D that encloses all of the bits rendered by this ImageGraphicAttribute.

getDescent

public float getDescent()
Returns the descent of this ImageGraphicAttribute. The descent of an ImageGraphicAttribute is the distance from the origin to the bottom of the image.

Overrides:
getDescent in class GraphicAttribute
Returns:
the descent of this ImageGraphicAttribute.

hashCode

public int hashCode()
Returns a hashcode for this ImageGraphicAttribute.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.