public final class ShapeGraphicAttribute extends GraphicAttribute
ShapeGraphicAttribute类的实现GraphicAttribute绘制形状在TextLayout 。
GraphicAttribute
| Modifier and Type | Field and Description |
|---|---|
static boolean |
FILL
一个表示形状的键应该被填充。
|
static boolean |
STROKE
一个指示形状的键应该用1像素宽的笔划来抚摸。
|
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT| Constructor and Description |
|---|
ShapeGraphicAttribute(Shape shape, int alignment, boolean stroke)
为指定的 ShapeGraphicAttribute构造一个ShapeGraphicAttribute 。
|
| Modifier and Type | Method and Description |
|---|---|
void |
draw(Graphics2D graphics, float x, float y)
在指定的位置渲染此
GraphicAttribute 。
|
boolean |
equals(Object rhs)
将此
ShapeGraphicAttribute与指定的Object进行
Object 。
|
boolean |
equals(ShapeGraphicAttribute rhs)
将此
ShapeGraphicAttribute与指定的ShapeGraphicAttribute进行
ShapeGraphicAttribute 。
|
float |
getAdvance()
返回此
ShapeGraphicAttribute 。
|
float |
getAscent()
返回此
ShapeGraphicAttribute的上升。
|
Rectangle2D |
getBounds()
返回一个 Rectangle2D ,其中包含由此ShapeGraphicAttribute相对于渲染位置绘制的所有位。
|
float |
getDescent()
返回此
ShapeGraphicAttribute的下降。
|
Shape |
getOutline(AffineTransform tx)
返回一个 Shape ,代表这个ShapeGraphicAttribute呈现的区域。
|
int |
hashCode()
返回此
ShapeGraphicAttribute的哈希码。
|
getAlignment, getJustificationInfopublic static final boolean STROKE
public static final boolean FILL
public ShapeGraphicAttribute(Shape shape, int alignment, boolean stroke)
ShapeGraphicAttribute构造一个ShapeGraphicAttribute 。
shape - 要呈现的Shape 。
Shape的原始来源于这个ShapeGraphicAttribute的主机TextLayout 。
此对象维护对shape的shape 。
alignment - 这个
ShapeGraphicAttribute一个
ShapeGraphicAttribute 。
stroke - true如果Shape应该抚摸;
false如果要填写Shape 。
public float getAscent()
ShapeGraphicAttribute的上升。
一的上升ShapeGraphicAttribute是从它的起源的正距离Shape它的边界的顶部Shape 。
getAscent在
GraphicAttribute
ShapeGraphicAttribute的上升。
GraphicAttribute.getBounds()
public float getDescent()
ShapeGraphicAttribute的下降。
一个ShapeGraphicAttribute的下降是ShapeGraphicAttribute的起源到其Shape的边界的底部的Shape 。
getDescent在
GraphicAttribute
ShapeGraphicAttribute的下降。
GraphicAttribute.getBounds()
public float getAdvance()
ShapeGraphicAttribute 。
一个ShapeGraphicAttribute的提前是从它的Shape的起源到它的Shape的边界的右边的Shape 。
getAdvance在
GraphicAttribute
ShapeGraphicAttribute 。
GraphicAttribute.getBounds()
public void draw(Graphics2D graphics, float x, float y)
GraphicAttribute 。
draw在
GraphicAttribute
graphics - 用于呈现图形的Graphics2D
x - 呈现图形的用户空间X坐标
y - 呈现图形的用户空间Y坐标
public Rectangle2D getBounds()
Rectangle2D ,它包含相对于渲染位置由此ShapeGraphicAttribute绘制的所有位。
图形可以超出它的起源,上升,下降或提前;
但是如果这样做,则该方法的实现应该指示图形的呈现位置。
getBounds在
GraphicAttribute
Rectangle2D封装了这个
ShapeGraphicAttribute呈现的所有位。
public Shape getOutline(AffineTransform tx)
Shape ,表示这个ShapeGraphicAttribute呈现的区域。
当需要TextLayout返回文本大纲时使用。
的(未转化的)形状不能由返回的矩形边界之外延伸getBounds 。
getOutline在
GraphicAttribute
tx - 一个可选的AffineTransform适用于这个ShapeGraphicAttribute 。
这可以是null。
Shape代表这种图形属性,适合于抚摸或填充。
public int hashCode()
ShapeGraphicAttribute的哈希码。
hashCode在
Object类
ShapeGraphicAttribute的哈希码值。
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)
public boolean equals(Object rhs)
ShapeGraphicAttribute与指定的Object进行
Object 。
equals在
Object
rhs -
Object比较相等
true如果这ShapeGraphicAttribute等于rhs ;
false否则。
Object.hashCode() , HashMap
public boolean equals(ShapeGraphicAttribute rhs)
ShapeGraphicAttribute与指定的ShapeGraphicAttribute进行
ShapeGraphicAttribute 。
rhs -
ShapeGraphicAttribute比较相等
true如果这ShapeGraphicAttribute等于rhs ;
false否则。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.