JavaTM 2
Platform
Std. Ed. v1.4.0

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)
          指定された位置にグラフィックを描画します。
 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 のディセントを返します。
 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 は、この ShapeGraphicAttribute の原点を基点としてホスト TextLayout に描画される。オブジェクトは shape への参照を格納する
alignment - ShapeGraphicAttribute からの配置方法のひとつ
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)
指定された位置にグラフィックを描画します。Shape は (x, y) を原点として描画されます。

定義:
クラス GraphicAttribute 内の draw
パラメータ:
graphics - グラフィックの描画領域となる Graphics2D

getBounds

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

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

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 2
Platform
Std. Ed. v1.4.0

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

Java、Java 2D、および JDBC は米国ならびにその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.