クラスLineBorder

すべての実装されたインタフェース:
Serializable, Border
直系の既知のサブクラス:
BorderUIResource.LineBorderUIResource

public class LineBorder extends AbstractBorder
直線ボーダーを実装するクラスです。ボーダーの太さは任意、カラーは単色です。

警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースと互換ではなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4では、すべてのJavaBeansの長期ストレージのサポートがjava.beansパッケージに追加されました。 XMLEncoderを参照してください。

  • フィールドのサマリー

    フィールド
    修飾子と型
    フィールド
    説明
    protected Color
    ボーダーの色。
    protected boolean
    ボーダーが角を丸めたかどうか。
    protected int
    ボーダーの厚さ。
  • コンストラクタのサマリー

    コンストラクタ
    コンストラクタ
    説明
    直線ボーダーを、指定されたカラーおよび太さ(thickness = 1)で作成します。
    LineBorder(Color color, int thickness)
    指定された色と太さで直線ボーダーを作成します。
    LineBorder(Color color, int thickness, boolean roundedCorners)
    指定された色と太さと隅の形状で直線ボーダーを作成します。
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    static Border
    太さ1でColor.blackのLineBorderを取得するのに便利なメソッドです。
    static Border
    太さ1でColor.grayのLineBorderを取得するのに便利なメソッドです。
    insetsパラメータを、このBorderの現在のInsetsで初期化し直します。
    ボーダーのカラーを返します。
    boolean
    ボーダーの隅を丸く描画するかどうかを返します。
    int
    ボーダーの太さを返します。
    boolean
    ボーダーが不透明かどうかを返します。
    void
    paintBorder(Component c, Graphics g, int x, int y, int width, int height)
    指定されたコンポーネントのボーダーを、指定された位置およびサイズでペイントします。

    クラスで宣言されたメソッド AbstractBorder

    getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
    修飾子と型
    メソッド
    説明
    int
    getBaseline(Component c, int width, int height)
    ベースラインを返します。
    サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。
    このデフォルトの実装は、AbstractBorder.getBorderInsets(Component,Insets)メソッドによって初期化される新しいInsetsオブジェクトを返します。
    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)
    ボーダーのイン・セットから引数の値を減算して矩形を返します。

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

    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であるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
  • フィールド詳細

    • thickness

      protected int thickness
      ボーダーの厚さ。
    • lineColor

      protected Color lineColor
      ボーダーの色。
    • roundedCorners

      protected boolean roundedCorners
      ボーダーが角を丸めたかどうか。
  • コンストラクタの詳細

    • LineBorder

      public LineBorder(Color color)
      直線ボーダーを、指定されたカラーおよび太さ(thickness = 1)で作成します。
      パラメータ:
      color - ボーダーのカラー
    • LineBorder

      public LineBorder(Color color, int thickness)
      指定された色と太さで直線ボーダーを作成します。
      パラメータ:
      color - ボーダーのカラー
      thickness - ボーダーの太さ
    • LineBorder

      @ConstructorProperties({"lineColor","thickness","roundedCorners"}) public LineBorder(Color color, int thickness, boolean roundedCorners)
      指定された色と太さと隅の形状で直線ボーダーを作成します。
      パラメータ:
      color - ボーダーのカラー
      thickness - ボーダーの太さ
      roundedCorners - ボーダーの隅を丸くするかどうか
      導入されたバージョン:
      1.3
  • メソッドの詳細

    • createBlackLineBorder

      public static Border createBlackLineBorder()
      太さ1でColor.blackのLineBorderを取得するのに便利なメソッドです。
      戻り値:
      LineBorderColor.blackと1の厚さ
    • createGrayLineBorder

      public static Border createGrayLineBorder()
      太さ1でColor.grayのLineBorderを取得するのに便利なメソッドです。
      戻り値:
      LineBorderColor.grayと1の厚さ
    • 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オブジェクト
      スロー:
      NullPointerException - 指定されたinsetsnullである場合
    • getLineColor

      public Color getLineColor()
      ボーダーのカラーを返します。
      戻り値:
      このオブジェクトの色を表すColorオブジェクト
    • getThickness

      public int getThickness()
      ボーダーの太さを返します。
      戻り値:
      このボーダーの太さ
    • getRoundedCorners

      public boolean getRoundedCorners()
      ボーダーの隅を丸く描画するかどうかを返します。
      戻り値:
      trueこのボーダーが角を丸くする必要がある場合
      導入されたバージョン:
      1.3
    • isBorderOpaque

      public boolean isBorderOpaque()
      ボーダーが不透明かどうかを返します。
      定義:
      isBorderOpaque、インタフェースBorder
      オーバーライド:
      isBorderOpaque、クラスAbstractBorder
      戻り値:
      枠線が不透明な場合はtrue、そうでない場合はfalse