- java.lang.Object
-
- java.awt.font.GraphicAttribute
-
- java.awt.font.ImageGraphicAttribute
-
public final class ImageGraphicAttribute extends GraphicAttribute
该ImageGraphicAttribute类的实现GraphicAttribute其中提请在图像TextLayout。- 另请参见:
-
GraphicAttribute
-
-
Field Summary
-
Fields inherited from class java.awt.font.GraphicAttribute
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT
-
-
构造方法摘要
构造方法 Constructor 描述 ImageGraphicAttribute(Image image, int alignment)构造一个ImageGraphicAttribute从指定Image。ImageGraphicAttribute(Image image, int alignment, float originX, float originY)构造一个ImageGraphicAttribute从指定Image。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 voiddraw(Graphics2D graphics, float x, float y)在指定的位置渲染此GraphicAttribute。booleanequals(ImageGraphicAttribute rhs)将此ImageGraphicAttribute与指定的ImageGraphicAttribute。booleanequals(Object rhs)将此ImageGraphicAttribute比较为Object。floatgetAdvance()返回此ImageGraphicAttribute。floatgetAscent()返回此ImageGraphicAttribute的上升。Rectangle2DgetBounds()返回一个Rectangle2D,它包含相对于渲染位置的由此ImageGraphicAttribute呈现的所有位。floatgetDescent()返回此ImageGraphicAttribute的下降。inthashCode()返回此ImageGraphicAttribute的哈希ImageGraphicAttribute。-
Methods inherited from class java.awt.font.GraphicAttribute
getAlignment, getJustificationInfo, getOutline
-
-
-
-
构造方法详细信息
-
ImageGraphicAttribute
public ImageGraphicAttribute(Image image, int alignment)
构造一个ImageGraphicAttribute从指定Image。 原点是(0,0)。- 参数
-
image- 由Image呈现的ImageGraphicAttribute。 此对象保留对image的引用。 -
alignment- 这个ImageGraphicAttribute的对齐方式ImageGraphicAttribute
-
ImageGraphicAttribute
public ImageGraphicAttribute(Image image, int alignment, float originX, float originY)
构造一个ImageGraphicAttribute从指定Image。 点(originX,originY的)Image出现在原点ImageGraphicAttribute文本中。- 参数
-
image- 由Image呈现的ImageGraphicAttribute。 此对象保留对image的引用。 -
alignment- 这个ImageGraphicAttribute的对齐方式ImageGraphicAttribute -
originX-Image中出现在文本行ImageGraphicAttribute原点的点的X坐标。 -
originY-将内的点的Y坐标Image出现在原点ImageGraphicAttribute的文本行。
-
-
方法详细信息
-
getAscent
public float getAscent()
返回此ImageGraphicAttribute的上升。ImageGraphicAttribute的上升是从图像顶部到原点的距离。- Specified by:
-
getAscent在GraphicAttribute - 结果
-
这个
ImageGraphicAttribute的上升。 - 另请参见:
-
GraphicAttribute.getBounds()
-
getDescent
public float getDescent()
返回此ImageGraphicAttribute的下降。ImageGraphicAttribute的下降是从原点到图像底部的距离。- Specified by:
-
getDescent在GraphicAttribute - 结果
-
这个
ImageGraphicAttribute的下降。 - 另请参见:
-
GraphicAttribute.getBounds()
-
getAdvance
public float getAdvance()
返回这个ImageGraphicAttribute。ImageGraphicAttribute是从原始图像到右边缘的距离。- Specified by:
-
getAdvance中的GraphicAttribute - 结果
-
这个进步
ImageGraphicAttribute。 - 另请参见:
-
GraphicAttribute.getBounds()
-
getBounds
public Rectangle2D getBounds()
返回一个Rectangle2D,它包含相对于渲染位置的由此ImageGraphicAttribute呈现的所有位。 图形可以超出它的起源,上升,下降或提前; 但是如果是,则该方法的实现必须指示图形的呈现位置。- 重写:
-
getBounds在GraphicAttribute - 结果
-
一个
Rectangle2D,其中包含了由此ImageGraphicAttribute呈现的所有位。
-
draw
public void draw(Graphics2D graphics, float x, float y)
在指定的位置渲染此GraphicAttribute。- Specified by:
-
draw中的GraphicAttribute - 参数
-
graphics- 用于呈现图形的Graphics2D -
x- 呈现图形的用户空间X坐标 -
y- 呈现图形的用户空间Y坐标
-
hashCode
public int hashCode()
返回此ImageGraphicAttribute的哈希ImageGraphicAttribute。- 重写:
-
hashCode在Object - 结果
- 该对象的哈希码值。
- 另请参见:
-
Object.equals(java.lang.Object),System.identityHashCode(java.lang.Object)
-
equals
public boolean equals(Object rhs)
比较该ImageGraphicAttribute到指定Object。- 重写:
-
equals在Object - 参数
-
rhs- 相对于Object进行比较 - 结果
-
true如果这个ImageGraphicAttribute等于rhs; 否则为false。 - 另请参见:
-
Object.hashCode(),HashMap
-
equals
public boolean equals(ImageGraphicAttribute rhs)
比较该ImageGraphicAttribute到指定ImageGraphicAttribute。- 参数
-
rhs- 相对于ImageGraphicAttribute进行比较 - 结果
-
true如果这个ImageGraphicAttribute等于rhs; 否则为false。
-
-