|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.awt.font.GraphicAttribute
java.awt.font.ShapeGraphicAttribute
public final class ShapeGraphicAttribute
ShapeGraphicAttribute 类是以 TextLayout 形式绘制形状的 GraphicAttribute 的实现。
GraphicAttribute
| 字段摘要 | |
|---|---|
static boolean |
FILL 指示应填充该形状的键。 |
static boolean |
STROKE 指示该形状应使用 1 像素宽的笔画进行勾画的键。 |
| 从类 java.awt.font.GraphicAttribute 继承的字段 |
|---|
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT |
| 构造方法摘要 | |
|---|---|
ShapeGraphicAttribute(Shape shape, int alignment, boolean stroke) 针对指定 Shape 构造 ShapeGraphicAttribute。 |
|
| 方法摘要 | |
|---|---|
void |
draw(Graphics2D graphics, float x, float y) 在指定的位置呈现此 GraphicAttribute。 |
boolean |
equals(Object rhs) 将此 ShapeGraphicAttribute 与指定的 Object 进行比较。 |
boolean |
equals(ShapeGraphicAttribute rhs) 将此 ShapeGraphicAttribute 与指定的 ShapeGraphicAttribute 进行比较。 |
float |
getAdvance() 返回此 ShapeGraphicAttribute 的 advance。 |
float |
getAscent() 返回此 ShapeGraphicAttribute 的 ascent。 |
Rectangle2D |
getBounds() 返回一个 Rectangle2D,它封装此 ShapeGraphicAttribute 相对于呈现位置绘制的所有位。 |
float |
getDescent() 返回此 ShapeGraphicAttribute 的 descent。 |
Shape |
getOutline(AffineTransform tx) 返回一个表示此 ShapeGraphicAttribute 呈现区域的 Shape。 |
int |
hashCode() 返回此 ShapeGraphicAttribute 的哈希码。 |
| 从类 java.awt.font.GraphicAttribute 继承的方法 |
|---|
getAlignment, getJustificationInfo |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
public static final boolean STROKE
public static final boolean FILL
| 构造方法详细信息 |
|---|
public ShapeGraphicAttribute(Shape shape,
int alignment,
boolean stroke)
Shape 构造
ShapeGraphicAttribute。
shape - 要呈现的
Shape。呈现此
Shape,其原点在宿主
TextLayout 中此
ShapeGraphicAttribute 的原点位置。此对象维护对
shape 的引用。
alignment - 此
ShapeGraphicAttribute 的对齐方式之一。
stroke - 如果要勾画
Shape,则为
true;如果要填充
Shape,则为
false。
| 方法详细信息 |
|---|
public float getAscent()
ShapeGraphicAttribute 的 ascent。
ShapeGraphicAttribute 的 ascent 是从其
Shape 的原点到其
Shape 边界顶端的绝对距离。
GraphicAttribute 中的
getAscent
ShapeGraphicAttribute 的 ascent。
GraphicAttribute.getBounds()
public float getDescent()
ShapeGraphicAttribute 的 descent。
ShapeGraphicAttribute 的 descent 是从其
Shape 的原点到其
Shape 边界底部的距离。
GraphicAttribute 中的
getDescent
ShapeGraphicAttribute 的 descent。
GraphicAttribute.getBounds()
public float getAdvance()
ShapeGraphicAttribute 的 advance。
ShapeGraphicAttribute 的 advance 是从其
Shape 的原点到其
Shape 边界右侧的距离。
GraphicAttribute 中的
getAdvance
ShapeGraphicAttribute 的 advance。
GraphicAttribute.getBounds()
public void draw(Graphics2D graphics,
float x,
float y)
GraphicAttribute。
GraphicAttribute 中的
draw
graphics - 将该图形呈现到的
Graphics2D
public Rectangle2D getBounds()
Rectangle2D,它封装此
ShapeGraphicAttribute 相对于呈现位置绘制的所有位。图形可以呈现在其原点、ascent、descent 和 advance 之外;但如果这样做,此方法的实现应指示呈现该图形的位置。
GraphicAttribute 中的
getBounds
ShapeGraphicAttribute 呈现的所有位的
Rectangle2D。
public Shape getOutline(AffineTransform tx)
ShapeGraphicAttribute 呈现区域的
Shape。此方法在请求
TextLayout 返回文本轮廓时使用。该轮廓(未变换)不能扩展
getBounds 返回的矩形边界。
GraphicAttribute 中的
getOutline
tx - 将应用于此
ShapeGraphicAttribute 的可选
AffineTransform。该参数可以为 null。
Shape,适用于勾画或填充。
public int hashCode()
ShapeGraphicAttribute 的哈希码。
Object 中的
hashCode
ShapeGraphicAttribute 的哈希码值。
Object.equals(java.lang.Object),
Hashtable
public boolean equals(Object rhs)
ShapeGraphicAttribute 与指定的
Object 进行比较。
Object 中的
equals
rhs - 比较相等性的
Object
ShapeGraphicAttribute 等于
rhs,则返回
true;否则返回
false。
Object.hashCode(),
Hashtable
public boolean equals(ShapeGraphicAttribute rhs)
ShapeGraphicAttribute 与指定的
ShapeGraphicAttribute 进行比较。
rhs - 要比较相等性的
ShapeGraphicAttribute
ShapeGraphicAttribute 等于
rhs,则返回
true;否则返回
false。
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。