- java.lang.Object
-
- javax.swing.border.AbstractBorder
-
- すべての実装されたインタフェース:
Serializable,Border
- 直系の既知のサブクラス:
BasicBorders.ButtonBorder,BasicBorders.FieldBorder,BasicBorders.MarginBorder,BasicBorders.MenuBarBorder,BevelBorder,CompoundBorder,EmptyBorder,EtchedBorder,LineBorder,MetalBorders.ButtonBorder,MetalBorders.Flush3DBorder,MetalBorders.InternalFrameBorder,MetalBorders.MenuBarBorder,MetalBorders.MenuItemBorder,MetalBorders.OptionDialogBorder,MetalBorders.PaletteBorder,MetalBorders.PopupMenuBorder,MetalBorders.ScrollPaneBorder,MetalBorders.TableHeaderBorder,MetalBorders.ToolBarBorder,StrokeBorder,TitledBorder
public abstract class AbstractBorder extends Object implements Border, Serializable
サイズ指定のない空のボーダーを実装するクラスです。 ほかのボーダーのクラスを簡単に派生できる、便利な基底クラスを提供します。警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースと互換ではなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4以降、すべてのJavaBeans™用の長期間の格納サポートが
java.beansパッケージに追加されています。XMLEncoderを参照してください。- 関連項目:
- 直列化された形式
-
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 AbstractBorder()
-
メソッドのサマリー
すべてのメソッド 静的メソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 intgetBaseline(Component c, int width, int height)ベースラインを返します。Component.BaselineResizeBehaviorgetBaselineResizeBehavior(Component c)サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。InsetsgetBorderInsets(Component c)このデフォルトの実装は、getBorderInsets(Component,Insets)メソッドによって初期化される新しいInsetsオブジェクトを返します。InsetsgetBorderInsets(Component c, Insets insets)インセット・パラメータを、このBorderの現在のイン・セットで初期化し直します。RectanglegetInteriorRectangle(Component c, int x, int y, int width, int height)静的メソッドを呼び出す簡易メソッドです。static RectanglegetInteriorRectangle(Component c, Border b, int x, int y, int width, int height)ボーダーのイン・セットから引数の値を減算して矩形を返します。booleanisBorderOpaque()このデフォルト実装はfalseを返します。voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height)このデフォルト実装では、ペイントを行いません。
-
-
-
メソッドの詳細
-
paintBorder
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
このデフォルト実装では、ペイントを行いません。- 定義:
paintBorder、インタフェースBorder- パラメータ:
c- このボーダーがペイントされるコンポーネントg- ペイント・グラフィックスx- ペイントされるボーダーのx座標y- ペイントされるボーダーのy座標width- ペイントされるボーダーの幅height- ペイントされるボーダーの高さ
-
getBorderInsets
public Insets getBorderInsets(Component c)
このデフォルトの実装は、getBorderInsets(Component,Insets)メソッドによって初期化される新しいInsetsオブジェクトを返します。 デフォルトでは、top、left、bottom、およびrightフィールドは0に設定されます。- 定義:
getBorderInsets、インタフェースBorder- パラメータ:
c- このボーダーのイン・セットの値を適用するコンポーネント- 戻り値:
- 新しい
Insetsオブジェクト
-
getBorderInsets
public Insets getBorderInsets(Component c, Insets insets)
インセット・パラメータを、このBorderの現在のイン・セットで初期化し直します。- パラメータ:
c- このボーダーのイン・セットの値を適用するコンポーネントinsets- 初期化し直されるオブジェクト- 戻り値:
insetsオブジェクト
-
isBorderOpaque
public boolean isBorderOpaque()
このデフォルト実装はfalseを返します。- 定義:
isBorderOpaque、インタフェースBorder- 戻り値:
- false
-
getInteriorRectangle
public Rectangle getInteriorRectangle(Component c, int x, int y, int width, int height)
静的メソッドを呼び出す簡易メソッドです。- パラメータ:
c- このボーダーが計算されるコンポーネントx- ボーダーのx座標y- ボーダーのy座標width- ボーダーの幅height- ボーダーの高さ- 戻り値:
- 内部座標を持つ
Rectangle
-
getInteriorRectangle
public static Rectangle getInteriorRectangle(Component c, Border b, int x, int y, int width, int height)
ボーダーのイン・セットから引数の値を減算して矩形を返します。 コンポーネントが描画して埋める領域を、ボーダーと交差しないように決めるのに便利です。- パラメータ:
c- このボーダーが計算されるコンポーネントb-Borderオブジェクトx- ボーダーのx座標y- ボーダーのy座標width- ボーダーの幅height- ボーダーの高さ- 戻り値:
- 内部座標を持つ
Rectangle
-
getBaseline
public int getBaseline(Component c, int width, int height)
ベースラインを返します。 戻り値が0より小さい場合は、ボーダーのベースラインが適切ではありません。デフォルト実装は -1を返します。 ベースラインをサポートするサブクラスで適切にオーバーライドする必要があります。 戻り値が0以上の場合、コンポーネントのベースラインは最小サイズ以上の任意のサイズに対して有効であり、
getBaselineResizeBehaviorを使ってサイズによるベースラインの変化を特定できます。- パラメータ:
c- 要求されるComponentベースラインwidth- ベースラインを取得する幅height- ベースラインを取得する高さ- 戻り値:
- ベースラインまたは0より小さい値(適切なベースラインがないことを示す)
- 例外:
IllegalArgumentException- 幅または高さが0より小さい場合- 導入されたバージョン:
- 1.6
- 関連項目:
Component.getBaseline(int,int),Component.getBaselineResizeBehavior()
-
getBaselineResizeBehavior
public Component.BaselineResizeBehavior getBaselineResizeBehavior(Component c)
サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。 このメソッドは、主にレイアウト・マネージャとGUIビルダーで使用されます。デフォルトの実装は
BaselineResizeBehavior.OTHERを返し、ベースラインをサポートするサブクラスは適切にオーバーライドする必要があります。 サブクラスはnullを返さないようにしてください。ベースラインを計算できない場合は、BaselineResizeBehavior.OTHERを返します。 呼出し元はまず、getBaselineを使用して、ベースラインを要求するようにしてください。0以上の値が返された場合に、このメソッドを使用します。getBaselineで0未満の値が返された場合でも、このメソッドでBaselineResizeBehavior.OTHER以外の値を返すことは可能です。- パラメータ:
c- ベースラインのサイズ変更の動作を返すComponent- 戻り値:
- ボーダーのサイズ変更に伴うベースラインの変化を示す列挙
- 導入されたバージョン:
- 1.6
- 関連項目:
Component.getBaseline(int,int),Component.getBaselineResizeBehavior()
-
-