- java.lang.Object
-
- javax.swing.border.AbstractBorder
-
- javax.swing.border.CompoundBorder
-
- すべての実装されたインタフェース:
Serializable
,Border
- 直系の既知のサブクラス:
BorderUIResource.CompoundBorderUIResource
public class CompoundBorder extends AbstractBorder
2つのBorderオブジェクトを合成して単一のボーダーにするために使用する、複合Borderクラスです。合成は、内側Borderオブジェクトを外側Borderオブジェクトのイン・セットの中に入れ子にして行います。 たとえば、このクラスは、既存の装飾ボーダーのあるコンポーネントに空白のマージン・スペースを追加するために使用できます。Border border = comp.getBorder(); Border margin = new EmptyBorder(10,10,10,10); comp.setBorder(new CompoundBorder(border, margin));
警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースと互換ではなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4以降、すべてのJavaBeans™用の長期間の格納サポートが
java.beans
パッケージに追加されています。XMLEncoder
を参照してください。- 関連項目:
- 直列化された形式
-
-
フィールドのサマリー
フィールド 修飾子と型 フィールド 説明 protected Border
insideBorder
内側のボーダー。protected Border
outsideBorder
外側のボーダー。
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 CompoundBorder()
外側ボーダー、内側ボーダーがともにnullの複合ボーダーを作成します。CompoundBorder(Border outsideBorder, Border insideBorder)
指定された内側ボーダーおよび外側ボーダーによる複合ボーダーを作成します。
-
メソッドのサマリー
すべてのメソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 Insets
getBorderInsets(Component c, Insets insets)
insetsパラメータを、このBorderの現在のInsetsで初期化し直します。Border
getInsideBorder()
内側ボーダーのオブジェクトを返します。Border
getOutsideBorder()
外側ボーダーのオブジェクトを返します。boolean
isBorderOpaque()
複合ボーダーが不透明かどうかを返します。void
paintBorder(Component c, Graphics g, int x, int y, int width, int height)
複合ボーダーをペイントします。外側ボーダーを指定された位置とサイズでペイントしてから、内側ボーダーを指定された位置とサイズ(外側ボーダーのイン・セットでオフセット)でペイントします。-
クラス javax.swing.border.AbstractBorderで宣言されたメソッド
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
-
-
-
コンストラクタの詳細
-
CompoundBorder
public CompoundBorder()
外側ボーダー、内側ボーダーがともにnullの複合ボーダーを作成します。
-
CompoundBorder
@ConstructorProperties({"outsideBorder","insideBorder"}) public CompoundBorder(Border outsideBorder, Border insideBorder)
指定された内側ボーダーおよび外側ボーダーによる複合ボーダーを作成します。 内側、外側のどちらも、nullにしてもかまいません。- パラメータ:
outsideBorder
- 外側ボーダーinsideBorder
- 入れ子にする内側ボーダー
-
-
メソッドの詳細
-
isBorderOpaque
public boolean isBorderOpaque()
複合ボーダーが不透明かどうかを返します。- 定義:
isBorderOpaque
、インタフェースBorder
- オーバーライド:
isBorderOpaque
、クラスAbstractBorder
- 戻り値:
- 内側、外側のボーダーがどちらも
null
でなく、不透明である場合はtrue
、そうでない場合はfalse
-
paintBorder
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
複合ボーダーをペイントします。外側ボーダーを指定された位置とサイズでペイントしてから、内側ボーダーを指定された位置とサイズ(外側ボーダーのイン・セットでオフセット)でペイントします。- 定義:
paintBorder
、インタフェースBorder
- オーバーライド:
paintBorder
、クラスAbstractBorder
- パラメータ:
c
- このボーダーがペイントされるコンポーネントg
- ペイント・グラフィックスx
- ペイントされるボーダーのx座標y
- ペイントされるボーダーのy座標width
- ペイントされるボーダーの幅height
- ペイントされるボーダーの高さ
-
getBorderInsets
public Insets getBorderInsets(Component c, Insets insets)
insetsパラメータを、このBorderの現在のInsetsで初期化し直します。- オーバーライド:
getBorderInsets
、クラスAbstractBorder
- パラメータ:
c
- このボーダーのイン・セットの値を適用するコンポーネントinsets
- 初期化し直されるオブジェクト- 戻り値:
insets
オブジェクト
-
getOutsideBorder
public Border getOutsideBorder()
外側ボーダーのオブジェクトを返します。- 戻り値:
- 外側の
Border
オブジェクト
-
getInsideBorder
public Border getInsideBorder()
内側ボーダーのオブジェクトを返します。- 戻り値:
- 内側の
Border
オブジェクト
-
-