|
JavaTM 2 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 中的 getAscentShapeGraphicAttribute 的 ascent。GraphicAttribute.getBounds()public float getDescent()
ShapeGraphicAttribute 的 descent。ShapeGraphicAttribute 的 descent 是從其 Shape 的原點到其 Shape 邊界底部的距離。
GraphicAttribute 中的 getDescentShapeGraphicAttribute 的 descent。GraphicAttribute.getBounds()public float getAdvance()
ShapeGraphicAttribute 的 advance。ShapeGraphicAttribute 的 advance 是從其 Shape 的原點到其 Shape 邊界右側的距離。
GraphicAttribute 中的 getAdvanceShapeGraphicAttribute 的 advance。GraphicAttribute.getBounds()
public void draw(Graphics2D graphics,
float x,
float y)
GraphicAttribute。
GraphicAttribute 中的 drawgraphics - 將該圖形呈現到的 Graphics2Dpublic Rectangle2D getBounds()
Rectangle2D,它封裝此 ShapeGraphicAttribute 相對於呈現位置繪製的所有位。圖形可以呈現在其原點、ascent、descent 和 advance 之外;但如果這樣做,此方法的實作應指示呈現該圖形的位置。
GraphicAttribute 中的 getBoundsShapeGraphicAttribute 呈現的所有位的 Rectangle2D。public Shape getOutline(AffineTransform tx)
ShapeGraphicAttribute 呈現區域的 Shape。此方法在請求 TextLayout 返回文本輪廓時使用。該輪廓(未變換)不能擴展 getBounds 返回的矩形邊界。
GraphicAttribute 中的 getOutlinetx - 將應用於此 ShapeGraphicAttribute 的可選 AffineTransform。該參數可以為 null。
Shape,適用於勾畫或填充。public int hashCode()
ShapeGraphicAttribute 的雜湊碼。
Object 中的 hashCodeShapeGraphicAttribute 的雜湊碼值。Object.equals(java.lang.Object),
Hashtablepublic boolean equals(Object rhs)
ShapeGraphicAttribute 與指定的 Object 進行比較。
Object 中的 equalsrhs - 比較相等性的 Object
ShapeGraphicAttribute 等於 rhs,則返回 true;否則返回 false。Object.hashCode(),
Hashtablepublic boolean equals(ShapeGraphicAttribute rhs)
ShapeGraphicAttribute 與指定的 ShapeGraphicAttribute 進行比較。
rhs - 要比較相等性的 ShapeGraphicAttribute
ShapeGraphicAttribute 等於 rhs,則返回 true;否則返回 false。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。