模块 java.desktop

类 ImageGraphicAttribute

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

public final class ImageGraphicAttribute extends GraphicAttribute
ImageGraphicAttribute 类是 GraphicAttribute 的一个实现,它在 TextLayout 中绘制图像。
参见:
  • 构造方法详细信息

    • ImageGraphicAttribute

      public ImageGraphicAttribute(Image  image, int alignment)
      从指定的 Image 构造一个 ImageGraphicAttribute 。原点位于 (0, 0)。
      参数:
      image - 由这个 ImageGraphicAttribute 渲染的 Image。该对象保留对 image 的引用。
      alignment - 来自这个 ImageGraphicAttribute 的路线之一
    • ImageGraphicAttribute

      public ImageGraphicAttribute(Image  image, int alignment, float originX, float originY)
      从指定的 Image 构造一个 ImageGraphicAttributeImage 中的点 (originX , originY ) 出现在文本中 ImageGraphicAttribute 的原点处。
      参数:
      image - 由这个 ImageGraphicAttribute 渲染的 Image。该对象保留对 image 的引用。
      alignment - 来自这个 ImageGraphicAttribute 的路线之一
      originX - Image 中出现在文本行中 ImageGraphicAttribute 原点处的点的 X 坐标。
      originY - Image 中出现在文本行中 ImageGraphicAttribute 原点处的点的 Y 坐标。
  • 方法详情

    • getAscent

      public float getAscent()
      返回此 ImageGraphicAttribute 的上升。 ImageGraphicAttribute 的上升是从图像顶部到原点的距离。
      指定者:
      getAscent 在类 GraphicAttribute
      返回:
      这个ImageGraphicAttribute的上升。
      参见:
    • getDescent

      public float getDescent()
      返回此 ImageGraphicAttribute 的血统。 ImageGraphicAttribute 的下降是从原点到图像底部的距离。
      指定者:
      getDescent 在类 GraphicAttribute
      返回:
      这个 ImageGraphicAttribute 的血统。
      参见:
    • getAdvance

      public float getAdvance()
      返回此 ImageGraphicAttribute 的预付款。 ImageGraphicAttribute 的前进是从原点到图像右边缘的距离。
      指定者:
      getAdvance 在类 GraphicAttribute
      返回:
      这个 ImageGraphicAttribute 的进步。
      参见:
    • getBounds

      public Rectangle2D  getBounds()
      返回一个 Rectangle2D ,它包含此 ImageGraphicAttribute 相对于渲染位置渲染的所有位。图形可以在其起源、上升、下降或前进之外呈现;但如果是,则此方法的实现必须指明图形的呈现位置。
      重写:
      getBounds 在类 GraphicAttribute
      返回:
      一个 Rectangle2D 包含了这个 ImageGraphicAttribute 呈现的所有位。
    • draw

      public void draw(Graphics2D  graphics, float x, float y)
      在指定位置呈现此 GraphicAttribute
      指定者:
      draw 在类 GraphicAttribute
      参数:
      graphics - 渲染图形的 Graphics2D
      x - 渲染图形的用户空间 X 坐标
      y - 渲染图形的用户空间 Y 坐标
    • hashCode

      public int hashCode()
      返回此 ImageGraphicAttribute 的哈希码。
      重写:
      hashCode 在类 Object
      返回:
      此对象的哈希码值。
      参见:
    • equals

      public boolean equals(Object  rhs)
      将此 ImageGraphicAttribute 与指定的 Object 进行比较。
      重写:
      equals 在类 Object
      参数:
      rhs - 比较相等的 Object
      返回:
      true 如果这个 ImageGraphicAttribute 等于 rhsfalse否则。
      参见:
    • equals

      public boolean equals(ImageGraphicAttribute  rhs)
      将此 ImageGraphicAttribute 与指定的 ImageGraphicAttribute 进行比较。
      参数:
      rhs - 比较相等的 ImageGraphicAttribute
      返回:
      true 如果这个 ImageGraphicAttribute 等于 rhsfalse否则。