java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.StrokeBorder
- すべての実装されたインタフェース:
- Serializable,- Border
public class StrokeBorder extends AbstractBorder
任意のストロークのボーダーを実装するクラスです。
 
 警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースと互換ではなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4以降、すべてのJavaBeans™用の長期間の格納サポートがjava.beansパッケージに追加されています。 XMLEncoderを参照してください。 
- 導入されたバージョン:
- 1.7
- 
コンストラクタのサマリーコンストラクタ コンストラクタ 説明 StrokeBorder(BasicStroke stroke)指定されたstrokeのボーダーを作成します。StrokeBorder(BasicStroke stroke, Paint paint)指定されたstrokeとpaintのボーダーを作成します。
- 
メソッドのサマリー修飾子と型 メソッド 説明 InsetsgetBorderInsets(Component c, Insets insets)insetsパラメータを、このボーダーの現在のイン・セットで初期化し直します。PaintgetPaint()ボーダーの描画中に色を生成するために使われるPaintオブジェクトを返します。BasicStrokegetStroke()ボーダーのレンダリング中に図形を描くために使用されるBasicStrokeオブジェクトを返します。voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height)指定されたコンポーネントのボーダーを、指定された位置およびサイズでペイントします。クラス javax.swing.border.AbstractBorderで宣言されたメソッドgetBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
- 
コンストラクタの詳細- 
StrokeBorderpublic StrokeBorder(BasicStroke stroke)指定されたstrokeのボーダーを作成します。 コンポーネントのフォアグラウンド・カラーがボーダーの描画に使われます。- パラメータ:
- stroke- 図形のストロークに使用される- BasicStrokeオブジェクト
- 例外:
- NullPointerException- 指定された- strokeが- nullである場合
 
- 
StrokeBorder@ConstructorProperties({"stroke","paint"})public StrokeBorder(BasicStroke stroke, Paint paint)指定されたstrokeとpaintのボーダーを作成します。 指定されたpaintがnullの場合は、ボーダーのレンダリングにコンポーネントのフォアグラウンド・カラーが使用されます。- パラメータ:
- stroke- 図形のストロークに使用される- BasicStrokeオブジェクト
- paint- 色の生成に使用される- Paintオブジェクト
- 例外:
- NullPointerException- 指定された- strokeが- nullである場合
 
 
- 
- 
メソッドの詳細- 
paintBorder指定されたコンポーネントのボーダーを、指定された位置およびサイズでペイントします。 ボーダーがPaintオブジェクトを使用して指定されなかった場合は、ボーダーのレンダリングにコンポーネントのフォアグラウンド・カラーが使用されます。 コンポーネントのフォアグラウンド・カラーが使用できない場合は、Graphicsオブジェクトのデフォルト・カラーが使用されます。- 定義:
- paintBorder、インタフェース:- Border
- オーバーライド:
- paintBorder、クラス:- AbstractBorder
- パラメータ:
- c- このボーダーがペイントされるコンポーネント
- g- ペイント・グラフィックス
- x- ペイントされるボーダーのx座標
- y- ペイントされるボーダーのy座標
- width- ペイントされるボーダーの幅
- height- ペイントされるボーダーの高さ
- 例外:
- NullPointerException- 指定された- gが- nullである場合
 
- 
getBorderInsetsinsetsパラメータを、このボーダーの現在のイン・セットで初期化し直します。 すべてのイン・セットは、ボーダーをペイントする際に使用されるストロークのライン幅以上で、最小の(負の無限大にもっとも近い)整数値です。- オーバーライド:
- getBorderInsets、クラス:- AbstractBorder
- パラメータ:
- c- このボーダーのイン・セットの値を適用するコンポーネント
- insets- 初期化し直される- Insetsオブジェクト
- 戻り値:
- 初期化し直されたinsetsパラメータ
- 例外:
- NullPointerException- 指定された- insetsが- nullである場合
- 関連項目:
- Math.ceil(double)
 
- 
getStrokepublic BasicStroke getStroke()ボーダーのレンダリング中に図形を描くために使用されるBasicStrokeオブジェクトを返します。- 戻り値:
- BasicStrokeオブジェクト
 
- 
getPaintpublic Paint getPaint()ボーダーの描画中に色を生成するために使われるPaintオブジェクトを返します。- 戻り値:
- Paintオブジェクト。- paintパラメータが設定されていない場合は- null
 
 
-