java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ButtonUI
javax.swing.plaf.basic.BasicButtonUI
- 直系の既知のサブクラス:
BasicToggleButtonUI,MetalButtonUI,SynthButtonUI
public class BasicButtonUI extends ButtonUI
BasicButton実装です。
-
フィールドのサマリー
フィールド 修飾子と型 フィールド 説明 protected intdefaultTextIconGapテキストとアイコンのデフォルトの間隔です。protected intdefaultTextShiftOffsetテキストのデフォルトのオフセットです。 -
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 BasicButtonUI() -
メソッドのサマリー
修飾子と型 メソッド 説明 protected voidclearTextShiftOffset()テキストのオフセットをクリアします。protected BasicButtonListenercreateButtonListener(AbstractButton b)BasicButtonListenerの新しいインスタンスを返します。static ComponentUIcreateUI(JComponent c)BasicButtonUIのインスタンスを返します。intgetBaseline(JComponent c, int width, int height)ベースラインを返します。Component.BaselineResizeBehaviorgetBaselineResizeBehavior(JComponent c)サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。intgetDefaultTextIconGap(AbstractButton b)テキストとアイコンのデフォルトの間隔を返します。protected StringgetPropertyPrefix()プロパティのプレフィクスを返します。protected intgetTextShiftOffset()テキストのオフセットを返します。protected voidinstallDefaults(AbstractButton b)デフォルトのプロパティをインストールします。protected voidinstallKeyboardActions(AbstractButton b)キーボード・アクションを登録します。protected voidinstallListeners(AbstractButton b)リスナーを登録します。protected voidpaintButtonPressed(Graphics g, AbstractButton b)押されたボタンをペイントします。protected voidpaintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)フォーカスされたボタンをペイントします。protected voidpaintIcon(Graphics g, JComponent c, Rectangle iconRect)現在のボタンのアイコンをペイントします。protected voidpaintText(Graphics g, AbstractButton b, Rectangle textRect, String text)現在のボタンのテキストをレンダリングするメソッドです。protected voidpaintText(Graphics g, JComponent c, Rectangle textRect, String text)現在のボタンのテキストをレンダリングするメソッドです。protected voidsetTextShiftOffset()テキストのオフセットを設定します。protected voiduninstallDefaults(AbstractButton b)デフォルト・プロパティをアンインストールします。protected voiduninstallKeyboardActions(AbstractButton b)キーボード・アクションを登録解除します。protected voiduninstallListeners(AbstractButton b)リスナーの登録を解除します。クラス javax.swing.plaf.ComponentUIで宣言されたメソッド
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
-
フィールド詳細
-
defaultTextIconGap
protected int defaultTextIconGapテキストとアイコンのデフォルトの間隔です。 -
defaultTextShiftOffset
protected int defaultTextShiftOffsetテキストのデフォルトのオフセットです。
-
-
コンストラクタの詳細
-
BasicButtonUI
public BasicButtonUI()
-
-
メソッドの詳細
-
createUI
public static ComponentUI createUI(JComponent c)BasicButtonUIのインスタンスを返します。- パラメータ:
c- コンポーネント- 戻り値:
BasicButtonUIのインスタンス
-
getPropertyPrefix
protected String getPropertyPrefix()プロパティのプレフィクスを返します。- 戻り値:
- プロパティ・プレフィクス
-
installDefaults
protected void installDefaults(AbstractButton b)デフォルトのプロパティをインストールします。- パラメータ:
b- 抽象的なボタン
-
installListeners
protected void installListeners(AbstractButton b)リスナーを登録します。- パラメータ:
b- 抽象的なボタン
-
installKeyboardActions
protected void installKeyboardActions(AbstractButton b)キーボード・アクションを登録します。- パラメータ:
b- 抽象的なボタン
-
uninstallKeyboardActions
protected void uninstallKeyboardActions(AbstractButton b)キーボード・アクションを登録解除します。- パラメータ:
b- 抽象的なボタン
-
uninstallListeners
protected void uninstallListeners(AbstractButton b)リスナーの登録を解除します。- パラメータ:
b- 抽象的なボタン
-
uninstallDefaults
protected void uninstallDefaults(AbstractButton b)デフォルト・プロパティをアンインストールします。- パラメータ:
b- 抽象的なボタン
-
createButtonListener
protected BasicButtonListener createButtonListener(AbstractButton b)BasicButtonListenerの新しいインスタンスを返します。- パラメータ:
b- 抽象的なボタン- 戻り値:
BasicButtonListenerの新しいインスタンス
-
getDefaultTextIconGap
public int getDefaultTextIconGap(AbstractButton b)テキストとアイコンのデフォルトの間隔を返します。- パラメータ:
b- 抽象的なボタン- 戻り値:
- テキストとアイコンのデフォルトの間隔
-
paintIcon
protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect)現在のボタンのアイコンをペイントします。- パラメータ:
g-Graphicsのインスタンスc- コンポーネントiconRect- アイコンをレンダリングする境界の矩形
-
paintText
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text)現在のボタンのテキストをレンダリングするメソッドです。 Java 2プラットフォーム1.4以降では、このメソッドを使用したり、オーバーライドしたりしないようにしてください。 AbstractButton引数をとるpaintTextメソッドを使用します。- パラメータ:
g-Graphicsのインスタンスc- コンポーネントtextRect- テキストを描画する境界矩形text- レンダリングする文字列
-
paintText
protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text)現在のボタンのテキストをレンダリングするメソッドです。- パラメータ:
g- グラフィックス・コンテキストb- レンダリングする現在のボタンtextRect- テキストを描画する境界の矩形text- レンダリングする文字列- 導入されたバージョン:
- 1.4
-
paintFocus
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)フォーカスされたボタンをペイントします。- パラメータ:
g-Graphicsのインスタンスb- 抽象的なボタンviewRect- ボタンをレンダリングする枠の矩形textRect- テキストを描画する境界矩形iconRect- アイコンをレンダリングする境界の矩形
-
paintButtonPressed
protected void paintButtonPressed(Graphics g, AbstractButton b)押されたボタンをペイントします。- パラメータ:
g-Graphicsのインスタンスb- 抽象的なボタン
-
clearTextShiftOffset
protected void clearTextShiftOffset()テキストのオフセットをクリアします。 -
setTextShiftOffset
protected void setTextShiftOffset()テキストのオフセットを設定します。 -
getTextShiftOffset
protected int getTextShiftOffset()テキストのオフセットを返します。- 戻り値:
- テキストのオフセット
-
getBaseline
public int getBaseline(JComponent c, int width, int height)ベースラインを返します。- オーバーライド:
getBaseline、クラス:ComponentUI- パラメータ:
c- ベースラインが要求されるJComponentwidth- ベースラインを取得する幅height- ベースラインを取得する高さ- 戻り値:
- ベースラインまたは0より小さい値(適切なベースラインがないことを示す)
- 例外:
NullPointerException-cがnullである場合IllegalArgumentException- 幅または高さが0より小さい場合- 導入されたバージョン:
- 1.6
- 関連項目:
JComponent.getBaseline(int, int)
-
getBaselineResizeBehavior
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。- オーバーライド:
getBaselineResizeBehavior、クラス:ComponentUI- パラメータ:
c- ベースラインのサイズ変更の動作を返すJComponent- 戻り値:
- コンポーネント・サイズの変化に合わせてベースラインがどのように変化するかを示す列挙
- 例外:
NullPointerException-cがnullである場合- 導入されたバージョン:
- 1.6
- 関連項目:
JComponent.getBaseline(int, int)
-