JavaTM 2 Platform
Std. Ed. v1.3

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 のアセント

getDescent

public float getDescent()
この ShapeGraphicAttribute のディセントを返します。ShapeGraphicAttribute のディセントは、Shape の原点と Shape の境界の下端との距離です。
オーバーライド:
クラス GraphicAttribute 内の getDescent
戻り値:
この ShapeGraphicAttribute のディセント

getAdvance

public float getAdvance()
この ShapeGraphicAttribute の有効幅を返します。ShapeGraphicAttribute の有効幅は、Shape の原点と Shape の境界の右端との距離です。
オーバーライド:
クラス GraphicAttribute 内の getAdvance
戻り値:
この ShapeGraphicAttribute の有効幅

draw

public void draw(Graphics2D graphics,
                 float x,
                 float y)
指定された位置にグラフィックを描画します。Shape は (x, y) を原点として描画されます。
オーバーライド:
クラス GraphicAttribute 内の draw
パラメータ:
graphics - グラフィックの描画領域となる Graphics2D
x, y - グラフィックが描画されるユーザ領域の座標

getBounds

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

hashCode

public int hashCode()
この ShapeGraphicAttribute のハッシュコードを返します。
オーバーライド:
クラス Object 内の hashCode
戻り値:
この ShapeGraphicAttribute のハッシュコードの値

equals

public boolean equals(Object rhs)
この ShapeGraphicAttribute を指定された Object と比較します。
オーバーライド:
クラス Object 内の equals
パラメータ:
rhs - 比較対象の Object
戻り値:
この ShapeGraphicAttributerhs と等しい場合は true、そうでない場合は false

equals

public boolean equals(ShapeGraphicAttribute rhs)
この ShapeGraphicAttribute を指定された ShapeGraphicAttribute と比較します。
パラメータ:
rhs - 比較対象の ShapeGraphicAttribute
戻り値:
この ShapeGraphicAttributerhs と等しい場合は true、そうでない場合は false

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

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