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
のボーダーを作成します。 -
メソッドのサマリー
修飾子と型メソッド説明getBorderInsets
(Component c, Insets insets) insets
パラメータを、このボーダーの現在のイン・セットで初期化し直します。getPaint()
ボーダーの描画中に色を生成するために使われるPaint
オブジェクトを返します。ボーダーのレンダリング中に図形を描くために使用されるBasicStroke
オブジェクトを返します。void
paintBorder
(Component c, Graphics g, int x, int y, int width, int height) 指定されたコンポーネントのボーダーを、指定された位置およびサイズでペイントします。クラス javax.swing.border.AbstractBorderで宣言されたメソッド
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
-
コンストラクタの詳細
-
StrokeBorder
public 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
である場合
-
getBorderInsets
insets
パラメータを、このボーダーの現在のイン・セットで初期化し直します。 すべてのイン・セットは、ボーダーをペイントする際に使用されるストロークのライン幅以上で、最小の(負の無限大にもっとも近い)整数値です。- オーバーライド:
getBorderInsets
、クラスAbstractBorder
- パラメータ:
c
- このボーダーのイン・セットの値を適用するコンポーネントinsets
- 初期化し直されるInsets
オブジェクト- 戻り値:
- 初期化し直された
insets
パラメータ - 例外:
NullPointerException
- 指定されたinsets
がnull
である場合- 関連項目:
-
getStroke
public BasicStroke getStroke()ボーダーのレンダリング中に図形を描くために使用されるBasicStroke
オブジェクトを返します。- 戻り値:
BasicStroke
オブジェクト
-
getPaint
public Paint getPaint()ボーダーの描画中に色を生成するために使われるPaint
オブジェクトを返します。- 戻り値:
Paint
オブジェクト。paint
パラメータが設定されていない場合はnull
-