Java プラットフォーム 1.2

java.awt
クラス TexturePaint

java.lang.Object
  |
  +--java.awt.TexturePaint

public class TexturePaint
extends Object
implements Paint

TexturePaint クラスは、BufferedImage として指定されるテクスチャーで Shape を塗りつぶす手段を提供します。TexturePaint オブジェクトによって BufferedImage データがコピーされるので、BufferedImage オブジェクトのサイズは小さくしておく必要があります。テクスチャーは、作成時にユーザ空間で指定される Rectangle2D の左上隅にアンカー設定されます。テクスチャーのデバイス空間での位置は、指定された Rectangle2D を、ユーザ空間ですべての方向に無限に複製し、複製された各 Rectangle2DBufferedImage をマッピングすることにより、計算されます。

関連項目:
Paint, Graphics2D.setPaint(java.awt.Paint)

コンストラクタの概要
TexturePaint(BufferedImage txtr, Rectangle2D anchor)
          TexturePaint オブジェクトを構築します。
 
メソッドの概要
 PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
          カラーパターンを生成するために使用されるコンテキストを作成して返します。
 Rectangle2D getAnchorRect()
          テクスチャーイメージの位置とサイズを指定するアンカー矩形のコピーを返します。
 BufferedImage getImage()
          図形を塗りつぶすために使用される BufferedImage テクスチャーを返します。
 int getTransparency()
          この TexturePaint の透明度モードを返します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

TexturePaint

public TexturePaint(BufferedImage txtr,
                    Rectangle2D anchor)
TexturePaint オブジェクトを構築します。
パラメータ:
txtr - 塗りつぶしに使用するテクスチャーを持つ BufferedImage オブジェクト
anchor - テクスチャーのアンカー設定および複製に使用されるユーザ空間内の Rectangle2D
メソッドの詳細

getImage

public BufferedImage getImage()
図形を塗りつぶすために使用される BufferedImage テクスチャーを返します。
戻り値:
BufferedImage

getAnchorRect

public Rectangle2D getAnchorRect()
テクスチャーイメージの位置とサイズを指定するアンカー矩形のコピーを返します。
戻り値:
この TexturePaint のアンカー設定およびサイズ指定を行うために使用される Rectangle2D

createContext

public PaintContext createContext(ColorModel cm,
                                  Rectangle deviceBounds,
                                  Rectangle2D userBounds,
                                  AffineTransform xform,
                                  RenderingHints hints)
カラーパターンを生成するために使用されるコンテキストを作成して返します。
定義:
インタフェース Paint 内の createContext
パラメータ:
cm - Paint データを受け取る ColorModel。これは単にヒントとして使用される
deviceBounds - 描画されるグラフィックスプリミティブのデバイス空間でのバウンディングボックス
userBounds - 描画されるグラフィックスプリミティブのユーザ空間でのバウンディングボックス
xform - ユーザ空間からデバイス空間への AffineTransform
hints - パターンの最終的な描画方法を指定するために使用できる RenderingHints オブジェクト
戻り値:
カラーパターン生成のための PaintContext
関連項目:
PaintContext

getTransparency

public int getTransparency()
この TexturePaint の透明度モードを返します。
戻り値:
この TexturePaint の透明度モード (int 値)
関連項目:
Transparency

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.