java.awt.font
Class ImageGraphicAttribute

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.font.GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute 
      extended by java.awt.font.ImageGraphicAttribute

public final class ImageGraphicAttribute
extends GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute

The ImageGraphicAttribute class is an implementation of GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute which draws images in a TextLayout sample code for java.awt.font.TextLayout definition code for java.awt.font.TextLayout .

See Also:
GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute

Field Summary
 
Fields inherited from class java.awt.font.GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute
BOTTOM_ALIGNMENT sample code for java.awt.font.GraphicAttribute.BOTTOM_ALIGNMENT definition code for java.awt.font.GraphicAttribute.BOTTOM_ALIGNMENT , CENTER_BASELINE sample code for java.awt.font.GraphicAttribute.CENTER_BASELINE definition code for java.awt.font.GraphicAttribute.CENTER_BASELINE , HANGING_BASELINE sample code for java.awt.font.GraphicAttribute.HANGING_BASELINE definition code for java.awt.font.GraphicAttribute.HANGING_BASELINE , ROMAN_BASELINE sample code for java.awt.font.GraphicAttribute.ROMAN_BASELINE definition code for java.awt.font.GraphicAttribute.ROMAN_BASELINE , TOP_ALIGNMENT sample code for java.awt.font.GraphicAttribute.TOP_ALIGNMENT definition code for java.awt.font.GraphicAttribute.TOP_ALIGNMENT
 
Constructor Summary
ImageGraphicAttribute sample code for java.awt.font.ImageGraphicAttribute.ImageGraphicAttribute(java.awt.Image, int) definition code for java.awt.font.ImageGraphicAttribute.ImageGraphicAttribute(java.awt.Image, int) (Image sample code for java.awt.Image definition code for java.awt.Image  image, int alignment)
          Constucts an ImageGraphicAttribute from the specified Image sample code for java.awt.Image definition code for java.awt.Image .
ImageGraphicAttribute sample code for java.awt.font.ImageGraphicAttribute.ImageGraphicAttribute(java.awt.Image, int, float, float) definition code for java.awt.font.ImageGraphicAttribute.ImageGraphicAttribute(java.awt.Image, int, float, float) (Image sample code for java.awt.Image definition code for java.awt.Image  image, int alignment, float originX, float originY)
          Constructs an ImageGraphicAttribute from the specified Image.
 
Method Summary
 void draw sample code for java.awt.font.ImageGraphicAttribute.draw(java.awt.Graphics2D, float, float) definition code for java.awt.font.ImageGraphicAttribute.draw(java.awt.Graphics2D, float, float) (Graphics2D sample code for java.awt.Graphics2D definition code for java.awt.Graphics2D  graphics, float x, float y)
          Renders the graphic at the specified location.
 boolean equals sample code for java.awt.font.ImageGraphicAttribute.equals(java.awt.font.ImageGraphicAttribute) definition code for java.awt.font.ImageGraphicAttribute.equals(java.awt.font.ImageGraphicAttribute) (ImageGraphicAttribute sample code for java.awt.font.ImageGraphicAttribute definition code for java.awt.font.ImageGraphicAttribute  rhs)
          Compares this ImageGraphicAttribute to the specified ImageGraphicAttribute.
 boolean equals sample code for java.awt.font.ImageGraphicAttribute.equals(java.lang.Object) definition code for java.awt.font.ImageGraphicAttribute.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  rhs)
          Compares this ImageGraphicAttribute to the specified Object sample code for java.lang.Object definition code for java.lang.Object .
 float getAdvance sample code for java.awt.font.ImageGraphicAttribute.getAdvance() definition code for java.awt.font.ImageGraphicAttribute.getAdvance() ()
          Returns the advance of this ImageGraphicAttribute.
 float getAscent sample code for java.awt.font.ImageGraphicAttribute.getAscent() definition code for java.awt.font.ImageGraphicAttribute.getAscent() ()
          Returns the ascent of this ImageGraphicAttribute.
 Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D getBounds sample code for java.awt.font.ImageGraphicAttribute.getBounds() definition code for java.awt.font.ImageGraphicAttribute.getBounds() ()
          Returns a Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D that encloses all of the bits rendered by this ImageGraphicAttribute, relative to the rendering position.
 float getDescent sample code for java.awt.font.ImageGraphicAttribute.getDescent() definition code for java.awt.font.ImageGraphicAttribute.getDescent() ()
          Returns the descent of this ImageGraphicAttribute.
 int hashCode sample code for java.awt.font.ImageGraphicAttribute.hashCode() definition code for java.awt.font.ImageGraphicAttribute.hashCode() ()
          Returns a hashcode for this ImageGraphicAttribute.
 
Methods inherited from class java.awt.font.GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute
getAlignment sample code for java.awt.font.GraphicAttribute.getAlignment() definition code for java.awt.font.GraphicAttribute.getAlignment() , getJustificationInfo sample code for java.awt.font.GraphicAttribute.getJustificationInfo() definition code for java.awt.font.GraphicAttribute.getJustificationInfo()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

ImageGraphicAttribute sample code for java.awt.font.ImageGraphicAttribute(java.awt.Image, int) definition code for java.awt.font.ImageGraphicAttribute(java.awt.Image, int)

public ImageGraphicAttribute(Image sample code for java.awt.Image definition code for java.awt.Image  image,
                             int alignment)
Constucts an ImageGraphicAttribute from the specified Image sample code for java.awt.Image definition code for java.awt.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 sample code for java.awt.font.ImageGraphicAttribute(java.awt.Image, int, float, float) definition code for java.awt.font.ImageGraphicAttribute(java.awt.Image, int, float, float)

public ImageGraphicAttribute(Image sample code for java.awt.Image definition code for java.awt.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, originY - the coordinates of the point within the Image that appears at the origin of the ImageGraphicAttribute in the text line.
Method Detail

getAscent sample code for java.awt.font.ImageGraphicAttribute.getAscent() definition code for java.awt.font.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.

Specified by:
getAscent sample code for java.awt.font.GraphicAttribute.getAscent() definition code for java.awt.font.GraphicAttribute.getAscent() in class GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute
Returns:
the ascent of this ImageGraphicAttribute.
See Also:
GraphicAttribute.getBounds() sample code for java.awt.font.GraphicAttribute.getBounds() definition code for java.awt.font.GraphicAttribute.getBounds()

getDescent sample code for java.awt.font.ImageGraphicAttribute.getDescent() definition code for java.awt.font.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.

Specified by:
getDescent sample code for java.awt.font.GraphicAttribute.getDescent() definition code for java.awt.font.GraphicAttribute.getDescent() in class GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute
Returns:
the descent of this ImageGraphicAttribute.
See Also:
GraphicAttribute.getBounds() sample code for java.awt.font.GraphicAttribute.getBounds() definition code for java.awt.font.GraphicAttribute.getBounds()

getAdvance sample code for java.awt.font.ImageGraphicAttribute.getAdvance() definition code for java.awt.font.ImageGraphicAttribute.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.

Specified by:
getAdvance sample code for java.awt.font.GraphicAttribute.getAdvance() definition code for java.awt.font.GraphicAttribute.getAdvance() in class GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute
Returns:
the advance of this ImageGraphicAttribute.
See Also:
GraphicAttribute.getBounds() sample code for java.awt.font.GraphicAttribute.getBounds() definition code for java.awt.font.GraphicAttribute.getBounds()

getBounds sample code for java.awt.font.ImageGraphicAttribute.getBounds() definition code for java.awt.font.ImageGraphicAttribute.getBounds()

public Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.Rectangle2D  getBounds()
Returns a Rectangle2D sample code for java.awt.geom.Rectangle2D definition code for java.awt.geom.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 sample code for java.awt.font.GraphicAttribute.getBounds() definition code for java.awt.font.GraphicAttribute.getBounds() in class GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute
Returns:
a Rectangle2D that encloses all of the bits rendered by this ImageGraphicAttribute.

draw sample code for java.awt.font.ImageGraphicAttribute.draw(java.awt.Graphics2D, float, float) definition code for java.awt.font.ImageGraphicAttribute.draw(java.awt.Graphics2D, float, float)

public void draw(Graphics2D sample code for java.awt.Graphics2D definition code for java.awt.Graphics2D  graphics,
                 float x,
                 float y)
Renders the graphic at the specified location.

Specified by:
draw sample code for java.awt.font.GraphicAttribute.draw(java.awt.Graphics2D, float, float) definition code for java.awt.font.GraphicAttribute.draw(java.awt.Graphics2D, float, float) in class GraphicAttribute sample code for java.awt.font.GraphicAttribute definition code for java.awt.font.GraphicAttribute
Parameters:
graphics - the Graphics2D sample code for java.awt.Graphics2D definition code for java.awt.Graphics2D into which to render the graphic
x, y - the user-space coordinates where the graphic is rendered

hashCode sample code for java.awt.font.ImageGraphicAttribute.hashCode() definition code for java.awt.font.ImageGraphicAttribute.hashCode()

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

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

equals sample code for java.awt.font.ImageGraphicAttribute.equals(java.lang.Object) definition code for java.awt.font.ImageGraphicAttribute.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  rhs)
Compares this ImageGraphicAttribute to the specified Object sample code for java.lang.Object definition code for java.lang.Object .

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
rhs - the Object to compare for equality
Returns:
true if this ImageGraphicAttribute equals rhs; false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

equals sample code for java.awt.font.ImageGraphicAttribute.equals(java.awt.font.ImageGraphicAttribute) definition code for java.awt.font.ImageGraphicAttribute.equals(java.awt.font.ImageGraphicAttribute)

public boolean equals(ImageGraphicAttribute sample code for java.awt.font.ImageGraphicAttribute definition code for java.awt.font.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.