Java プラットフォーム 1.2

javax.swing.border
クラス EtchedBorder

java.lang.Object
  |
  +--javax.swing.border.AbstractBorder
        |
        +--javax.swing.border.EtchedBorder
直接の既知のサブクラス:
BorderUIResource.EtchedBorderUIResource

public class EtchedBorder
extends AbstractBorder

簡単なエッチングボーダを実装するクラスです。浮き彫りエッチング、あるいは彫り込みエッチングのどちらも可能です。ボーダを作成するときにハイライトまたは陰影のカラーが初期化されない場合は、paintBorder() メソッドに渡されるコンポーネント引数によるバックグラウンドカラーから動的に派生します。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。

関連項目:
直列化された形式

フィールドの概要
protected  int etchType
           
protected  Color highlight
           
static int LOWERED
          彫り込みエッチングのタイプです。
static int RAISED
          浮き彫りエッチングのタイプです。
protected  Color shadow
           
 
コンストラクタの概要
EtchedBorder()
          彫り込みエッチングボーダを作成します。
EtchedBorder(Color highlight, Color shadow)
          彫り込みエッチングボーダを、指定されたハイライトおよび陰影のカラーで作成します。
EtchedBorder(int etchType)
          指定されたタイプのエッチングボーダを作成します。
EtchedBorder(int etchType, Color highlight, Color shadow)
          エッチングボーダを、指定されたタイプ、ハイライトおよび陰影のカラーで作成します。
 
メソッドの概要
 Insets getBorderInsets(Component c)
          ボーダのインセットの値を返します。
 Insets getBorderInsets(Component c, Insets insets)
          insets パラメータを、この Border の現在の Insets で初期化し直します。
 int getEtchType()
          エッチングボーダに指定されているエッチングのタイプを返します。
 Color getHighlightColor(Component c)
          エッチングボーダのハイライトのカラーを返します。
 Color getShadowColor(Component c)
          エッチングボーダの陰影のカラーを返します。
 boolean isBorderOpaque()
          ボーダが不透明かどうかを返します。
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          指定されたコンポーネントのボーダを、指定された位置およびサイズでペイントします。
 
クラス javax.swing.border.AbstractBorder から継承したメソッド
getInteriorRectangle, getInteriorRectangle
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

RAISED

public static final int RAISED
浮き彫りエッチングのタイプです。

LOWERED

public static final int LOWERED
彫り込みエッチングのタイプです。

etchType

protected int etchType

highlight

protected Color highlight

shadow

protected Color shadow
コンストラクタの詳細

EtchedBorder

public EtchedBorder()
彫り込みエッチングボーダを作成します。ボーダのカラーは、paintBorder メソッドに渡されるコンポーネントのバックグラウンドカラーから派生します。

EtchedBorder

public EtchedBorder(int etchType)
指定されたタイプのエッチングボーダを作成します。ボーダのカラーは、paintBorder メソッドに渡されるコンポーネントのバックグラウンドカラーから派生します。
パラメータ:
etchType - ボーダが描画するエッチングのタイプ

EtchedBorder

public EtchedBorder(Color highlight,
                    Color shadow)
彫り込みエッチングボーダを、指定されたハイライトおよび陰影のカラーで作成します。
パラメータ:
highlight - エッチングのハイライトに使うカラー
shadow - エッチングの陰影に使うカラー

EtchedBorder

public EtchedBorder(int etchType,
                    Color highlight,
                    Color shadow)
エッチングボーダを、指定されたタイプ、ハイライトおよび陰影のカラーで作成します。
パラメータ:
etchType - ボーダが描画するエッチングのタイプ
highlight - エッチングのハイライトに使うカラー
shadow - エッチングの陰影に使うカラー
メソッドの詳細

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
指定されたコンポーネントのボーダを、指定された位置およびサイズでペイントします。
パラメータ:
c - ボーダがペイントされるコンポーネント
g - ペイントのグラフィックス
x - ペイントされるボーダの x 座標
y - ペイントされるボーダの y 座標
width - ペイントされるボーダの幅
height - ペイントされるボーダの高さ
オーバーライド:
クラス AbstractBorder 内の paintBorder

getBorderInsets

public Insets getBorderInsets(Component c)
ボーダのインセットの値を返します。
パラメータ:
c - このボーダのインセットの値を適用するコンポーネント
オーバーライド:
クラス AbstractBorder 内の getBorderInsets

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
insets パラメータを、この Border の現在の Insets で初期化し直します。
パラメータ:
c - このボーダの insets の値を適用するコンポーネント
insets - 初期化し直されるオブジェクト
オーバーライド:
クラス AbstractBorder 内の getBorderInsets

isBorderOpaque

public boolean isBorderOpaque()
ボーダが不透明かどうかを返します。
オーバーライド:
クラス AbstractBorder 内の isBorderOpaque

getEtchType

public int getEtchType()
エッチングボーダに指定されているエッチングのタイプを返します。

getHighlightColor

public Color getHighlightColor(Component c)
エッチングボーダのハイライトのカラーを返します。

getShadowColor

public Color getShadowColor(Component c)
エッチングボーダの陰影のカラーを返します。

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.