- java.lang.Object
-
- java.awt.font.GraphicAttribute
-
- java.awt.font.ImageGraphicAttribute
-
public final class ImageGraphicAttribute extends GraphicAttribute
ImageGraphicAttribute
クラスは、TextLayout
にイメージをレンダリングするGraphicAttribute
の実装です。- 関連項目:
GraphicAttribute
-
-
フィールドのサマリー
-
クラス java.awt.font.GraphicAttributeから継承されるフィールド
BOTTOM_ALIGNMENT, CENTER_BASELINE, HANGING_BASELINE, ROMAN_BASELINE, TOP_ALIGNMENT
-
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 ImageGraphicAttribute(Image image, int alignment)
指定されたImage
からImageGraphicAttribute
を構築します。ImageGraphicAttribute(Image image, int alignment, float originX, float originY)
指定されたImage
からImageGraphicAttribute
を構築します。
-
メソッドのサマリー
すべてのメソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 void
draw(Graphics2D graphics, float x, float y)
このGraphicAttribute
を指定された位置にレンダリングします。boolean
equals(ImageGraphicAttribute rhs)
このImageGraphicAttribute
を指定されたImageGraphicAttribute
と比較します。boolean
equals(Object rhs)
このImageGraphicAttribute
を指定されたObject
と比較します。float
getAdvance()
このImageGraphicAttribute
の有効幅を返します。float
getAscent()
このImageGraphicAttribute
のアセントを返します。Rectangle2D
getBounds()
このImageGraphicAttribute
によってレンダリングされる全ビットを囲むRectangle2D
を返します。これは、レンダリング位置を基準にして示されます。float
getDescent()
このImageGraphicAttribute
のディセントを返します。int
hashCode()
このImageGraphicAttribute
のハッシュ・コードを返します。-
クラス java.awt.font.GraphicAttributeから継承されるメソッド
getAlignment, getJustificationInfo, getOutline
-
-
-
-
コンストラクタの詳細
-
ImageGraphicAttribute
public ImageGraphicAttribute(Image image, int alignment)
指定されたImage
からImageGraphicAttribute
を構築します。 原点は(0, 0)です。- パラメータ:
image
- このImageGraphicAttribute
によってレンダリングされるImage
。 このオブジェクトはimage
に対する参照を保持します。alignment
- 次に対する配置方法の1つ:ImageGraphicAttribute
-
ImageGraphicAttribute
public ImageGraphicAttribute(Image image, int alignment, float originX, float originY)
指定されたImage
からImageGraphicAttribute
を構築します。Image
内の点(originX
,originY
)は、テキスト内のImageGraphicAttribute
の原点に現われます。- パラメータ:
image
- このImageGraphicAttribute
によってレンダリングされるImage
。 このオブジェクトはimage
に対する参照を保持します。alignment
- 次に対する配置方法の1つ:ImageGraphicAttribute
originX
- テキスト行内のImageGraphicAttribute
の原点に現れる、Image
内の点のX座標。originY
- テキスト行内のImageGraphicAttribute
の原点に現れる、Image
内の点のY座標。
-
-
メソッドの詳細
-
getAscent
public float getAscent()
このImageGraphicAttribute
のアセントを返します。ImageGraphicAttribute
のアセントとは、イメージの上端から原点までの距離のことです。- 定義:
getAscent
、クラス:GraphicAttribute
- 戻り値:
- この
ImageGraphicAttribute
のアセント。 - 関連項目:
GraphicAttribute.getBounds()
-
getDescent
public float getDescent()
このImageGraphicAttribute
のディセントを返します。ImageGraphicAttribute
のディセントとは、原点からイメージの下端までの距離のことです。- 定義:
getDescent
、クラス:GraphicAttribute
- 戻り値:
- この
ImageGraphicAttribute
のディセント。 - 関連項目:
GraphicAttribute.getBounds()
-
getAdvance
public float getAdvance()
このImageGraphicAttribute
の有効幅を返します。ImageGraphicAttribute
の有効幅とは、原点からイメージの右端までの距離のことです。- 定義:
getAdvance
、クラス:GraphicAttribute
- 戻り値:
- この
ImageGraphicAttribute
の有効幅。 - 関連項目:
GraphicAttribute.getBounds()
-
getBounds
public Rectangle2D getBounds()
このImageGraphicAttribute
によってレンダリングされる全ビットを囲むRectangle2D
を返します。これは、レンダリング位置を基準にして示されます。 グラフィックは、原点、アセント、ディセント、有効幅を超えてレンダリングできますが、その場合はグラフィックをレンダリングする位置をこのメソッドの実装で示す必要があります。- オーバーライド:
getBounds
、クラス:GraphicAttribute
- 戻り値:
- この
ImageGraphicAttribute
によってレンダリングされる全ビットを囲むRectangle2D
。
-
draw
public void draw(Graphics2D graphics, float x, float y)
このGraphicAttribute
を指定された位置にレンダリングします。- 定義:
draw
、クラス:GraphicAttribute
- パラメータ:
graphics
- グラフィックのレンダリング先のGraphics2D
x
- グラフィックがレンダリングされるユーザー空間X座標y
- グラフィックがレンダリングされるユーザー空間Y座標
-
hashCode
public int hashCode()
このImageGraphicAttribute
のハッシュ・コードを返します。- オーバーライド:
hashCode
、クラス:Object
- 戻り値:
- このオブジェクトのハッシュ・コード値。
- 関連項目:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
equals
public boolean equals(Object rhs)
このImageGraphicAttribute
を指定されたObject
と比較します。- オーバーライド:
equals
、クラス:Object
- パラメータ:
rhs
- 等しいかどうかを比較するObject
- 戻り値:
- この
ImageGraphicAttribute
がrhs
の場合はtrue
、それ以外の場合はfalse
。 - 関連項目:
Object.hashCode()
、HashMap
-
equals
public boolean equals(ImageGraphicAttribute rhs)
このImageGraphicAttribute
を指定されたImageGraphicAttribute
と比較します。- パラメータ:
rhs
- 等しいかどうかを比較するImageGraphicAttribute
- 戻り値:
- この
ImageGraphicAttribute
がrhs
の場合はtrue
、それ以外の場合はfalse
。
-
-