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
を参照してください。
-
コンストラクタのサマリー
コンストラクタ -
メソッドのサマリー
修飾子と型メソッド説明int
getBaseline(Component c, int width, int height)
ベースラインを返します。サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。このデフォルトの実装は、getBorderInsets(Component,Insets)
メソッドによって初期化される新しいInsets
オブジェクトを返します。getBorderInsets(Component c, Insets insets)
インセット・パラメータを、このBorderの現在のイン・セットで初期化し直します。getInteriorRectangle(Component c, int x, int y, int width, int height)
静的メソッドを呼び出す簡易メソッドです。static Rectangle
getInteriorRectangle(Component c, Border b, int x, int y, int width, int height)
ボーダーのイン・セットから引数の値を減算して矩形を返します。boolean
このデフォルト実装はfalseを返します。void
paintBorder(Component c, Graphics g, int x, int y, int width, int height)
このデフォルト実装では、ペイントを行いません。
-
コンストラクタの詳細
-
AbstractBorder
protected AbstractBorder()サブクラスが呼び出すためのコンストラクタ。
-
-
メソッドの詳細
-
paintBorder
このデフォルト実装では、ペイントを行いません。- 定義:
paintBorder
、インタフェース:Border
- パラメータ:
c
- このボーダーがペイントされるコンポーネントg
- ペイント・グラフィックスx
- ペイントされるボーダーのx座標y
- ペイントされるボーダーのy座標width
- ペイントされるボーダーの幅height
- ペイントされるボーダーの高さ
-
getBorderInsets
このデフォルトの実装は、getBorderInsets(Component,Insets)
メソッドによって初期化される新しいInsets
オブジェクトを返します。 デフォルトでは、top
、left
、bottom
、およびright
フィールドは0
に設定されます。- 定義:
getBorderInsets
、インタフェース:Border
- パラメータ:
c
- このボーダーのイン・セットの値を適用するコンポーネント- 戻り値:
- 新しい
Insets
オブジェクト
-
getBorderInsets
インセット・パラメータを、このBorderの現在のイン・セットで初期化し直します。- パラメータ:
c
- このボーダーのイン・セットの値を適用するコンポーネントinsets
- 初期化し直されるオブジェクト- 戻り値:
insets
オブジェクト
-
isBorderOpaque
public boolean isBorderOpaque()このデフォルト実装はfalseを返します。- 定義:
isBorderOpaque
、インタフェース:Border
- 戻り値:
- false
-
getInteriorRectangle
静的メソッドを呼び出す簡易メソッドです。- パラメータ:
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()
-