java的attribute类_java.awt.font 类 ImageGraphicAttribute - Java 中文参考手册

java.lang.Object

c8e9f4e075d37a0af332e4af80182959.gifjava.awt.font.GraphicAttribute

c8e9f4e075d37a0af332e4af80182959.gifjava.awt.font.ImageGraphicAttribute

public final class ImageGraphicAttributeextends GraphicAttribute

ImageGraphicAttribute 类是在 TextLayout 中绘制图像的 GraphicAttribute 实现。

另请参见:GraphicAttribute

字段摘要

从类 java.awt.font.GraphicAttribute 继承的字段

BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT

构造方法摘要

ImageGraphicAttribute(Imageimage,

intalignment)

根据指定的 Image 构造一个 ImageGraphicAttribute。

ImageGraphicAttribute(Imageimage,

intalignment,

floatoriginX,

floatoriginY)

根据指定的 Image 构造一个 ImageGraphicAttribute。

方法摘要

void

draw(Graphics2Dgraphics,

floatx,

floaty)

在指定的位置呈现该图形。

boolean

equals(ImageGraphicAttributerhs)

比较此 ImageGraphicAttribute 与指定的 ImageGraphicAttribute。

boolean

equals(Objectrhs)

比较此 ImageGraphicAttribute 与指定的 Object。

float

getAdvance()

返回此 ImageGraphicAttribute 的 advance。

float

getAscent()

返回此 ImageGraphicAttribute 的 ascent。

Rectangle2D

getBounds()

返回包括所有相对于呈现位置并且由此 ImageGraphicAttribute 呈现的所有位的 Rectangle2D。

float

getDescent()

返回此 ImageGraphicAttribute 的 descent。

int

hashCode()

返回此 ImageGraphicAttribute 的哈希码。

从类 java.awt.font.GraphicAttribute 继承的方法

getAlignment, getJustificationInfo

从类 java.lang.Object 继承的方法

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

构造方法详细信息

ImageGraphicAttribute

public ImageGraphicAttribute(Imageimage,

intalignment)

根据指定的 Image 构造一个 ImageGraphicAttribute。该原点位于 (0,0)。

参数:image – 由此 ImageGraphicAttribute 呈现的 Image。此对象保存对 image 的引用。alignment – 此 ImageGraphicAttribute 的一种对齐方式。

ImageGraphicAttribute

public ImageGraphicAttribute(Imageimage,

intalignment,

floatoriginX,

floatoriginY)

根据指定的 Image 构造一个 ImageGraphicAttribute。Image 中的点 (originX,originY) 出现在文本中 ImageGraphicAttribute 的原点。

参数:image – 由此 ImageGraphicAttribute 呈现的 Image。此对象保存对 image 的引用。alignment – 此 ImageGraphicAttribute 的一种对齐方式originX,originY – Image 中点的坐标,它显示在文本行中 ImageGraphicAttribute 的原点。

方法详细信息

getAscent

public float getAscent()

返回此 ImageGraphicAttribute 的 ascent。ImageGraphicAttribute 的 ascent 是从该图像的顶端到原点的距离。

指定者:类 GraphicAttribute 中的 getAscent

返回:此 ImageGraphicAttribute 的 ascent。另请参见:GraphicAttribute.getBounds()

getDescent

public float getDescent()

返回此 ImageGraphicAttribute 的 descent。ImageGraphicAttribute 的 descent 是从原点到该图像底部的距离。

指定者:类 GraphicAttribute 中的 getDescent

返回:此 ImageGraphicAttribute 的 descent。另请参见:GraphicAttribute.getBounds()

getAdvance

public float getAdvance()

返回此 ImageGraphicAttribute 的 advance。ImageGraphicAttribute 的 advance 是从原点到该图像右边的距离。

指定者:类 GraphicAttribute 中的 getAdvance

返回:此 ImageGraphicAttribute 的 advance。另请参见:GraphicAttribute.getBounds()

getBounds

public Rectangle2D getBounds()

返回包括所有相对于呈现位置并且由此 ImageGraphicAttribute 呈现的所有位的 Rectangle2D。图形可以在其原点、ascent、descent 和 advance 之外呈现;但是如果这样的话,此方法的实现必须指示呈现该图形的位置。

覆盖:类 GraphicAttribute 中的 getBounds

返回:包括由此 ImageGraphicAttribute 呈现的所有位的 Rectangle2D。

draw

public void draw(Graphics2Dgraphics,

floatx,

floaty)

在指定的位置呈现该图形。

指定者:类 GraphicAttribute 中的 draw

参数:graphics – 将该图形呈现到的 Graphics2Dx, y – 呈现该图形的用户空间坐标

hashCode

public int hashCode()

返回此 ImageGraphicAttribute 的哈希码。

覆盖:类 Object 中的 hashCode

返回:此对象的哈希码值。另请参见:Object.equals(java.lang.Object),

Hashtable

equals

public boolean equals(Objectrhs)

比较此 ImageGraphicAttribute 与指定的 Object。

覆盖:类 Object 中的 equals

参数:rhs – 要测试相等性的 Object返回:如果 ImageGraphicAttribute 与此 rhs 相等,则返回 true;否则返回 false。另请参见:Object.hashCode(),

Hashtable

equals

public boolean equals(ImageGraphicAttributerhs)

比较此 ImageGraphicAttribute 与指定的 ImageGraphicAttribute。

参数:rhs – 要测试相等性的 ImageGraphicAttribute返回:如果 ImageGraphicAttribute 与此 rhs 相等,则返回 true;否则返回 false。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值