java.lang.Object
java.awt.font.GraphicAttribute
java.awt.font.ImageGraphicAttribute
- 参见:
-
Field Summary
Fields declared in class java.awt.font.GraphicAttribute
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT -
Constructor Summary
ConstructorsConstructorDescriptionImageGraphicAttribute(Image image, int alignment) 从指定的Image构造一个ImageGraphicAttribute。ImageGraphicAttribute(Image image, int alignment, float originX, float originY) 从指定的Image构造一个ImageGraphicAttribute。 -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D graphics, float x, float y) 在指定位置渲染此GraphicAttribute。boolean将此ImageGraphicAttribute与指定的ImageGraphicAttribute进行比较。boolean将此ImageGraphicAttribute与指定的Object进行比较。float返回此ImageGraphicAttribute的前进量。float返回此ImageGraphicAttribute的上升量。返回一个Rectangle2D,该矩形包围由此ImageGraphicAttribute渲染的所有位,相对于渲染位置。float返回此ImageGraphicAttribute的下降量。inthashCode()返回此ImageGraphicAttribute的哈希码。Methods declared in class java.awt.font.GraphicAttribute
getAlignment, getJustificationInfo, getOutline
-
Constructor Details
-
ImageGraphicAttribute
从指定的Image构造一个ImageGraphicAttribute。原点位于(0,0)。- 参数:
-
image- 此ImageGraphicAttribute渲染的Image。此对象保留对image的引用。 -
alignment- 来自此ImageGraphicAttribute的对齐方式之一
-
ImageGraphicAttribute
从指定的Image构造一个ImageGraphicAttribute。在文本中,Image中的点(originX,originY)出现在ImageGraphicAttribute的原点处。- 参数:
-
image- 此ImageGraphicAttribute渲染的Image。此对象保留对image的引用。 -
alignment- 来自此ImageGraphicAttribute的对齐方式之一 -
originX- 出现在文本行中ImageGraphicAttribute原点处的Image中点的X坐标。 -
originY- 出现在文本行中ImageGraphicAttribute原点处的Image中点的Y坐标。
-
-
Method Details
-
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
返回一个Rectangle2D,该矩形包围由此ImageGraphicAttribute渲染的所有位,相对于渲染位置。 图形可以渲染超出其原点、上升、下降或前进;但如果是这样,此方法的实现必须指示图形的渲染位置。- 覆盖:
-
getBounds在类中GraphicAttribute - 返回:
-
包围由此
ImageGraphicAttribute渲染的所有位的Rectangle2D。
-
draw
在指定位置渲染此GraphicAttribute。- 指定者:
-
draw在类中GraphicAttribute - 参数:
-
graphics- 渲染图形的Graphics2D -
x- 渲染图形的用户空间X坐标 -
y- 渲染图形的用户空间Y坐标
-
hashCode
public int hashCode()返回此ImageGraphicAttribute的哈希码。 -
equals
将此ImageGraphicAttribute与指定的Object进行比较。 -
equals
将此ImageGraphicAttribute与指定的ImageGraphicAttribute进行比较。- 参数:
-
rhs- 要比较相等的ImageGraphicAttribute - 返回:
-
如果此
ImageGraphicAttribute等于rhs,则返回true;否则返回false。
-