public final class ImageGraphicAttribute extends GraphicAttribute
ImageGraphicAttribute
クラスは、TextLayout
にイメージをレンダリングするGraphicAttribute
の実装です。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 のハッシュ・コードを返します。 |
getAlignment, getJustificationInfo, getOutline
public ImageGraphicAttribute(Image image, int alignment)
Image
からImageGraphicAttribute
を構築します。 原点は(0, 0)です。 image
- このImageGraphicAttribute
によってレンダリングされるImage
。 このオブジェクトはimage
に対する参照を保持します。 alignment
- ImageGraphicAttribute
に対する配置方法の1つpublic ImageGraphicAttribute(Image image, int alignment, float originX, float originY)
Image
からImageGraphicAttribute
を構築します。 Image
内の点(originX
, originY
)は、テキスト内のImageGraphicAttribute
の原点に現われます。 image
- このImageGraphicAttribute
によってレンダリングされるImage
。 このオブジェクトはimage
に対する参照を保持します。 alignment
- ImageGraphicAttribute
に対する配置方法の1つoriginX
- テキスト行内のImageGraphicAttribute
の原点に現れる、Image
内の点のX座標。originY
- テキスト行内のImageGraphicAttribute
の原点に現れる、Image
内の点のY座標。public float getAscent()
ImageGraphicAttribute
のアセントを返します。 ImageGraphicAttribute
のアセントとは、イメージの上端から原点までの距離のことです。 getAscent
、クラスGraphicAttribute
ImageGraphicAttribute
のアセント。GraphicAttribute.getBounds()
public float getDescent()
ImageGraphicAttribute
のディセントを返します。 ImageGraphicAttribute
のディセントとは、原点からイメージの下端までの距離のことです。 getDescent
、クラスGraphicAttribute
ImageGraphicAttribute
のディセント。GraphicAttribute.getBounds()
public float getAdvance()
ImageGraphicAttribute
の有効幅を返します。 ImageGraphicAttribute
の有効幅とは、原点からイメージの右端までの距離のことです。 getAdvance
、クラスGraphicAttribute
ImageGraphicAttribute
の有効幅。GraphicAttribute.getBounds()
public Rectangle2D getBounds()
ImageGraphicAttribute
によってレンダリングされる全ビットを囲むRectangle2D
を返します。これは、レンダリング位置を基準にして示されます。 グラフィックは、原点、アセント、ディセント、有効幅を超えてレンダリングできますが、その場合はグラフィックをレンダリングする位置をこのメソッドの実装で示す必要があります。 getBounds
、クラスGraphicAttribute
ImageGraphicAttribute
によってレンダリングされる全ビットを囲むRectangle2D
。public void draw(Graphics2D graphics, float x, float y)
GraphicAttribute
を指定された位置にレンダリングします。draw
、クラスGraphicAttribute
graphics
- グラフィックのレンダリング先のGraphics2D
x
- グラフィックがレンダリングされるユーザー空間X座標y
- グラフィックがレンダリングされるユーザー空間Y座標public int hashCode()
ImageGraphicAttribute
のハッシュ・コードを返します。hashCode
、クラスObject
Object.equals(java.lang.Object)
, System.identityHashCode(java.lang.Object)
public boolean equals(Object rhs)
ImageGraphicAttribute
を指定されたObject
と比較します。equals
、クラスObject
rhs
- 等しいかどうかを比較するObject
ImageGraphicAttribute
がrhs
の場合はtrue
、それ以外の場合はfalse
。Object.hashCode()
、HashMap
public boolean equals(ImageGraphicAttribute rhs)
ImageGraphicAttribute
を指定されたImageGraphicAttribute
と比較します。rhs
- 等しいかどうかを比較するImageGraphicAttribute
ImageGraphicAttribute
がrhs
の場合はtrue
、それ以外の場合はfalse
。 バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。