JavaTM Platform
Standard Ed. 6

javax.swing.border
クラス LineBorder

java.lang.Object
  上位を拡張 javax.swing.border.AbstractBorder
      上位を拡張 javax.swing.border.LineBorder
すべての実装されたインタフェース:
Serializable, Border
直系の既知のサブクラス:
BorderUIResource.LineBorderUIResource

public class LineBorder
extends AbstractBorder

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

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


フィールドの概要
protected  Color lineColor
           
protected  boolean roundedCorners
           
protected  int thickness
           
 
コンストラクタの概要
LineBorder(Color color)
          直線ボーダーを、指定されたカラーおよび太さ (thickness = 1) で作成します。
LineBorder(Color color, int thickness)
          指定された色と太さで直線ボーダーを作成します。
LineBorder(Color color, int thickness, boolean roundedCorners)
          指定された色と太さと隅の形状で直線ボーダーを作成します。
 
メソッドの概要
static Border createBlackLineBorder()
          太さ 1 で Color.black の LineBorder を取得するのに便利なメソッドです。
static Border createGrayLineBorder()
          太さ 1 で Color.gray の LineBorder を取得するのに便利なメソッドです。
 Insets getBorderInsets(Component c)
          ボーダーのインセットの値を返します。
 Insets getBorderInsets(Component c, Insets insets)
          insets パラメータを、この Border の現在の Insets で初期化し直します。
 Color getLineColor()
          ボーダーのカラーを返します。
 boolean getRoundedCorners()
          ボーダーの隅を丸く描画するかどうかを返します。
 int getThickness()
          ボーダーの太さを返します。
 boolean isBorderOpaque()
          ボーダーが不透明かどうかを返します。
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          指定されたコンポーネントのボーダーを、指定された位置およびサイズでペイントします。
 
クラス javax.swing.border.AbstractBorder から継承されたメソッド
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

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

public LineBorder(Color color,
                  int thickness,
                  boolean roundedCorners)
指定された色と太さと隅の形状で直線ボーダーを作成します。

パラメータ:
color - ボーダーのカラー
thickness - ボーダーの太さ
roundedCorners - ボーダーの隅を丸くするかどうか
導入されたバージョン:
1.3
メソッドの詳細

createBlackLineBorder

public static Border createBlackLineBorder()
太さ 1 で Color.black の LineBorder を取得するのに便利なメソッドです。


createGrayLineBorder

public static Border createGrayLineBorder()
太さ 1 で Color.gray の LineBorder を取得するのに便利なメソッドです。


paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
指定されたコンポーネントのボーダーを、指定された位置およびサイズでペイントします。

定義:
インタフェース Border 内の paintBorder
オーバーライド:
クラス AbstractBorder 内の paintBorder
パラメータ:
c - このボーダーがペイントされるコンポーネント
g - ペイントのグラフィックス
x - ペイントされたボーダーの x 座標
y - ペイントされたボーダーの y 座標
width - ペイントされたボーダーの幅
height - ペイントされたボーダーの高さ

getBorderInsets

public Insets getBorderInsets(Component c)
ボーダーのインセットの値を返します。

定義:
インタフェース Border 内の getBorderInsets
オーバーライド:
クラス AbstractBorder 内の getBorderInsets
パラメータ:
c - このボーダーのインセットの値を適用するコンポーネント
戻り値:
0 に初期化される新しい Insets オブジェクト

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
insets パラメータを、この Border の現在の Insets で初期化し直します。

オーバーライド:
クラス AbstractBorder 内の getBorderInsets
パラメータ:
c - このボーダーのインセットの値を適用するコンポーネント
insets - 初期化し直されるオブジェクト
戻り値:
insets オブジェクト

getLineColor

public Color getLineColor()
ボーダーのカラーを返します。


getThickness

public int getThickness()
ボーダーの太さを返します。


getRoundedCorners

public boolean getRoundedCorners()
ボーダーの隅を丸く描画するかどうかを返します。

導入されたバージョン:
1.3

isBorderOpaque

public boolean isBorderOpaque()
ボーダーが不透明かどうかを返します。

定義:
インタフェース Border 内の isBorderOpaque
オーバーライド:
クラス AbstractBorder 内の isBorderOpaque
戻り値:
false

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。