クラスAbstractBorder

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を参照してください。

  • コンストラクタのサマリー

    コンストラクタ
    修飾子
    コンストラクタ
    説明
    protected
    サブクラスが呼び出すためのコンストラクタ。
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    int
    getBaseline(Component c, int width, int height)
    ベースラインを返します。
    サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。
    このデフォルトの実装は、getBorderInsets(Component,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)
    このデフォルト実装では、ペイントを行いません。

    クラスオブジェクトで宣言されたメソッド

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    修飾子と型
    メソッド
    説明
    protected Object
    このオブジェクトのコピーを作成して、返します。
    boolean
    このオブジェクトと他のオブジェクトが等しいかどうかを示します。
    protected void
    削除予定のため非推奨: このAPI要素は、将来のバージョンで削除される可能性があります。
    最終決定は非推奨であり、将来のリリースで削除される可能性があります。
    final Class<?>
    このObjectの実行時クラスを返します。
    int
    このオブジェクトに対するハッシュ・コード値を返します。
    final void
    このオブジェクトのモニターで待機中のスレッドを1つ再開します。
    final void
    このオブジェクトのモニターで待機中のすべてのスレッドを再開します。
    オブジェクトの文字列表現を返します。
    final void
    現在のスレッドが目覚めるまで待機します。通常、notifiedまたはinterruptedです。
    final void
    wait(long timeoutMillis)
    現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
    final void
    wait(long timeoutMillis, int nanos)
    現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
  • コンストラクタの詳細

    • AbstractBorder

      protected AbstractBorder()
      サブクラスが呼び出すためのコンストラクタ。
  • メソッドの詳細

    • 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オブジェクトを返します。 デフォルトでは、topleftbottom、およびrightフィールドは0に設定されます。
      定義:
      getBorderInsets、インタフェースBorder
      パラメータ:
      c - このボーダーのイン・セットの値を適用するコンポーネント
      戻り値:
      新しいInsetsオブジェクト
    • getBorderInsets

      public Insets getBorderInsets(Component c, Insets insets)
      インセット・パラメータを、このBorderの現在のイン・セットで初期化し直します。
      パラメータ:
      c - このボーダーのイン・セットの値を適用するコンポーネント
      insets - 初期化し直されるオブジェクト
      戻り値:
      insetsオブジェクト
      スロー:
      NullPointerException - 指定されたinsetsnullである場合
    • 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
      関連項目:
    • getBaselineResizeBehavior

      public Component.BaselineResizeBehavior getBaselineResizeBehavior(Component c)
      サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。 このメソッドは、主にレイアウト・マネージャとGUIビルダーで使用されます。

      デフォルトの実装はBaselineResizeBehavior.OTHERを返し、ベースラインをサポートするサブクラスは適切にオーバーライドする必要があります。 サブクラスはnullを返さないようにしてください。ベースラインを計算できない場合は、BaselineResizeBehavior.OTHERを返します。 呼出し元はまず、getBaselineを使用して、ベースラインを要求するようにしてください。0以上の値が返された場合に、このメソッドを使用します。 getBaselineで0未満の値が返された場合でも、このメソッドでBaselineResizeBehavior.OTHER以外の値を返すことは可能です。

      パラメータ:
      c - ベースラインのサイズ変更の動作を返すComponent
      戻り値:
      ボーダーのサイズ変更に伴うベースラインの変化を示す列挙
      スロー:
      NullPointerException - Componentnullの場合
      導入されたバージョン:
      1.6
      関連項目: