- 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 BorderinsideBorder内側のボーダー。protected BorderoutsideBorder外側のボーダー。
 - 
コンストラクタのサマリーコンストラクタ コンストラクタ 説明 CompoundBorder()外側ボーダー、内側ボーダーがともにnullの複合ボーダーを作成します。CompoundBorder(Border outsideBorder, Border insideBorder)指定された内側ボーダーおよび外側ボーダーによる複合ボーダーを作成します。
 - 
メソッドのサマリーすべてのメソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 InsetsgetBorderInsets(Component c, Insets insets)insetsパラメータを、このBorderの現在のInsetsで初期化し直します。BordergetInsideBorder()内側ボーダーのオブジェクトを返します。BordergetOutsideBorder()外側ボーダーのオブジェクトを返します。booleanisBorderOpaque()複合ボーダーが不透明かどうかを返します。voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height)複合ボーダーをペイントします。外側ボーダーを指定された位置とサイズでペイントしてから、内側ボーダーを指定された位置とサイズ(外側ボーダーのイン・セットでオフセット)でペイントします。- 
クラス javax.swing.border.AbstractBorderから継承されたメソッドgetBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
 
- 
 
- 
- 
- 
コンストラクタの詳細- 
CompoundBorderpublic CompoundBorder() 外側ボーダー、内側ボーダーがともにnullの複合ボーダーを作成します。
 - 
CompoundBorder@ConstructorProperties({"outsideBorder","insideBorder"}) public CompoundBorder(Border outsideBorder, Border insideBorder) 指定された内側ボーダーおよび外側ボーダーによる複合ボーダーを作成します。 内側、外側のどちらも、nullにしてもかまいません。- パラメータ:
- outsideBorder- 外側ボーダー
- insideBorder- 入れ子にする内側ボーダー
 
 
- 
 - 
メソッドの詳細- 
isBorderOpaquepublic boolean isBorderOpaque() 複合ボーダーが不透明かどうかを返します。- 定義:
- isBorderOpaque、インタフェース:- Border
- オーバーライド:
- isBorderOpaque、クラス:- AbstractBorder
- 戻り値:
- 内側、外側のボーダーがどちらもnullでなく、不透明である場合はtrue、そうでない場合はfalse
 
 - 
paintBorderpublic 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- ペイントされるボーダーの高さ
 
 - 
getBorderInsetspublic Insets getBorderInsets(Component c, Insets insets) insetsパラメータを、このBorderの現在のInsetsで初期化し直します。- オーバーライド:
- getBorderInsets、クラス:- AbstractBorder
- パラメータ:
- c- このボーダーのイン・セットの値を適用するコンポーネント
- insets- 初期化し直されるオブジェクト
- 戻り値:
- insetsオブジェクト
 
 - 
getOutsideBorderpublic Border getOutsideBorder() 外側ボーダーのオブジェクトを返します。- 戻り値:
- 外側のBorderオブジェクト
 
 - 
getInsideBorderpublic Border getInsideBorder() 内側ボーダーのオブジェクトを返します。- 戻り値:
- 内側のBorderオブジェクト
 
 
- 
 
-