JavaTM Platform
Standard Ed. 6

java.awt.font
クラス ShapeGraphicAttribute

java.lang.Object
  上位を拡張 java.awt.font.GraphicAttribute
      上位を拡張 java.awt.font.ShapeGraphicAttribute

public final class ShapeGraphicAttribute
extends GraphicAttribute

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)
          指定された ShapeShapeGraphicAttribute を構築します。
 
メソッドの概要
 void draw(Graphics2D graphics, float x, float y)
          GraphicAttribute を、指定された位置に描画します。
 boolean equals(Object rhs)
          この ShapeGraphicAttribute を、指定された Object と比較します。
 boolean equals(ShapeGraphicAttribute rhs)
          この ShapeGraphicAttribute を、指定された ShapeGraphicAttribute と比較します。
 float getAdvance()
          この ShapeGraphicAttribute の有効幅を返します。
 float getAscent()
          この ShapeGraphicAttribute のアセントを返します。
 Rectangle2D getBounds()
          この ShapeGraphicAttribute によって描画される全ビットを囲む Rectangle2D を返します。
 float getDescent()
          この ShapeGraphicAttribute のディセントを返します。
 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
 

フィールドの詳細

STROKE

public static final boolean STROKE
1 ピクセル幅のストロークで描画する必要がある形状を示すキーです。

関連項目:
定数フィールド値

FILL

public static final boolean FILL
塗りつぶす必要がある形状を示すキーです。

関連項目:
定数フィールド値
コンストラクタの詳細

ShapeGraphicAttribute

public ShapeGraphicAttribute(Shape shape,
                             int alignment,
                             boolean stroke)
指定された ShapeShapeGraphicAttribute を構築します。

パラメータ:
shape - 描画する ShapeShape は ホスト TextLayout の この ShapeGraphicAttribute の原点を原点にして、 描画される。このオブジェクトは shape への参照を 保持する
alignment - この ShapeGraphicAttribute の 配置方法の 1 つ
stroke - Shape をストロークで描画する必要がある場合は trueShape を塗りつぶす必要がある場合は false
メソッドの詳細

getAscent

public float getAscent()
この ShapeGraphicAttribute のアセントを返します。ShapeGraphicAttribute のアセントはその Shape の原点から、その Shape の境界の最上部までの正の距離です。

定義:
クラス GraphicAttribute 内の getAscent
戻り値:
この ShapeGraphicAttribute のアセント
関連項目:
GraphicAttribute.getBounds()

getDescent

public float getDescent()
この ShapeGraphicAttribute のディセントを返します。ShapeGraphicAttribute のディセントとは、その Shape の原点から、その Shape の境界の最下部までの距離です。

定義:
クラス GraphicAttribute 内の getDescent
戻り値:
この ShapeGraphicAttribute のディセント
関連項目:
GraphicAttribute.getBounds()

getAdvance

public float getAdvance()
この ShapeGraphicAttribute の有効幅を返します。ShapeGraphicAttribute の有効幅とは、その Shape の原点から、その Shape の境界の右端までの距離です。

定義:
クラス GraphicAttribute 内の getAdvance
戻り値:
この ShapeGraphicAttribute の有効幅
関連項目:
GraphicAttribute.getBounds()

draw

public void draw(Graphics2D graphics,
                 float x,
                 float y)
GraphicAttribute を、指定された位置に描画します。

定義:
クラス GraphicAttribute 内の draw
パラメータ:
graphics - グラフィックの描画先の Graphics2D
x - グラフィックが描画されるユーザー空間 X 座標
y - グラフィックが描画されるユーザー空間 Y 座標

getBounds

public Rectangle2D getBounds()
この ShapeGraphicAttribute によって描画される全ビットを囲む Rectangle2D を返します。 これは、描画位置を基準にして示されます。グラフィックは、原点、アセント、ディセント、有効幅を超えて描画できますが、その場合はグラフィックを描画する位置をこのメソッドの実装で示す必要があります。

オーバーライド:
クラス GraphicAttribute 内の getBounds
戻り値:
この ShapeGraphicAttribute によって描画される 全ビットを囲む Rectangle2D

getOutline

public Shape getOutline(AffineTransform tx)
この ShapeGraphicAttribute によって描画される領域を表す Shape を返します。このメソッドは、TextLayout がテキストの輪郭を返すように要求されたときに使用されます。(変換されていない) 形状は、getBounds によって返される矩形境界の内側に収まっている必要があります。

オーバーライド:
クラス GraphicAttribute 内の getOutline
パラメータ:
tx - この ShapeGraphicAttribute の輪郭に適用する 任意指定の AffineTransformnull を指定できる。
戻り値:
ストローク描画や塗りつぶしに適した、 この GraphicAttribute を表す Shape
導入されたバージョン:
1.6

hashCode

public int hashCode()
この ShapeGraphicAttribute のハッシュコードを返します。

オーバーライド:
クラス Object 内の hashCode
戻り値:
この ShapeGraphicAttribute の ハッシュコード値
関連項目:
Object.equals(java.lang.Object), Hashtable

equals

public boolean equals(Object rhs)
この ShapeGraphicAttribute を、指定された Object と比較します。

オーバーライド:
クラス Object 内の equals
パラメータ:
rhs - 等しいかどうかを比較する Object
戻り値:
この ShapeGraphicAttributerhs と等しい場合は true、 そうでない場合は false
関連項目:
Object.hashCode(), Hashtable

equals

public boolean equals(ShapeGraphicAttribute rhs)
この ShapeGraphicAttribute を、指定された ShapeGraphicAttribute と比較します。

パラメータ:
rhs - 等しいかどうかを比較する ShapeGraphicAttribute
戻り値:
この ShapeGraphicAttributerhs と等しい場合は true、 そうでない場合は false

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。