public class BasicButtonUI extends ButtonUI
| 修飾子と型 | フィールド | 説明 |
|---|---|---|
protected int |
defaultTextIconGap |
|
protected int |
defaultTextShiftOffset |
| コンストラクタ | 説明 |
|---|---|
BasicButtonUI() |
| 修飾子と型 | メソッド | 説明 |
|---|---|---|
protected void |
clearTextShiftOffset() |
|
protected BasicButtonListener |
createButtonListener(AbstractButton b) |
|
static ComponentUI |
createUI(JComponent c) |
|
int |
getBaseline(JComponent c, int width, int height) |
ベースラインを返します。
|
Component.BaselineResizeBehavior |
getBaselineResizeBehavior(JComponent c) |
サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。
|
int |
getDefaultTextIconGap(AbstractButton b) |
|
Dimension |
getMaximumSize(JComponent c) |
指定されたコンポーネントの、Look & Feelに適した最大サイズを返します。
|
Dimension |
getMinimumSize(JComponent c) |
指定されたコンポーネントの、Look & Feelに適した最小サイズを返します。
|
Dimension |
getPreferredSize(JComponent c) |
指定されたコンポーネントの、Look & Feelに適した推奨サイズを返します。
|
protected String |
getPropertyPrefix() |
|
protected int |
getTextShiftOffset() |
|
protected void |
installDefaults(AbstractButton b) |
|
protected void |
installKeyboardActions(AbstractButton b) |
|
protected void |
installListeners(AbstractButton b) |
|
void |
installUI(JComponent c) |
指定されたコンポーネントをLook & Feelに応じて適切に構成します。
|
void |
paint(Graphics g, JComponent c) |
指定されたコンポーネントをLook & Feelに合わせてペイントします。
|
protected void |
paintButtonPressed(Graphics g, AbstractButton b) |
|
protected void |
paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) |
|
protected void |
paintIcon(Graphics g, JComponent c, Rectangle iconRect) |
|
protected void |
paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) |
現在のボタンのテキストをレンダリングするメソッドです。
|
protected void |
paintText(Graphics g, JComponent c, Rectangle textRect, String text) |
Java 2プラットフォーム1.4以降では、このメソッドを使用したり、オーバーライドしたりしないようにしてください。
|
protected void |
setTextShiftOffset() |
|
protected void |
uninstallDefaults(AbstractButton b) |
|
protected void |
uninstallKeyboardActions(AbstractButton b) |
|
protected void |
uninstallListeners(AbstractButton b) |
|
void |
uninstallUI(JComponent c) |
installUI時に、指定されたコンポーネントに対して行われた構成を取り消します。 |
contains, getAccessibleChild, getAccessibleChildrenCount, updateprotected int defaultTextIconGap
protected int defaultTextShiftOffset
public static ComponentUI createUI(JComponent c)
protected String getPropertyPrefix()
public void installUI(JComponent c)
ComponentUIComponentUIインスタンスが、指定されたコンポーネントのUI委譲としてインストールされているときに呼び出されます。 このメソッドは、次を含むLook & Feel用のコンポーネントを完全に構成するべきです。
LayoutManagerをインストールする。
PropertyChangeListenerを作成してコンポーネントにインストールする。
installUI、クラスComponentUIc - UI委譲がインストールされるコンポーネントComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()protected void installDefaults(AbstractButton b)
protected void installListeners(AbstractButton b)
protected void installKeyboardActions(AbstractButton b)
public void uninstallUI(JComponent c)
ComponentUIinstallUI時に、指定されたコンポーネントに対して行われた構成を取り消します。 このメソッドは、このUIComponentインスタンスが、指定されたコンポーネントのUI委譲として削除されているときに呼び出されます。 このメソッドは、installUIによって実行された構成を元に戻すべきです。この場合、JComponentインスタンスをクリーンな状態(余分なリスナーや、Look & Feel固有のプロパティ・オブジェクトが残らないように)にするよう十分注意してください。 手順には次のものが含まれるべきです。
uninstallUI、クラスComponentUIc - このUI委譲が削除されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるComponentUI.installUI(javax.swing.JComponent), JComponent.updateUI()protected void uninstallKeyboardActions(AbstractButton b)
protected void uninstallListeners(AbstractButton b)
protected void uninstallDefaults(AbstractButton b)
protected BasicButtonListener createButtonListener(AbstractButton b)
public int getDefaultTextIconGap(AbstractButton b)
public void paint(Graphics g, JComponent c)
ComponentUIComponentUI.updateメソッドから呼び出されます。 サブクラスは、このメソッドをオーバーライドして、指定されたGraphicsオブジェクトを使ってコンポーネントの内容を描画するべきです。 paint、クラスComponentUIg - ペイント対象のGraphicsコンテキストc - ペイントされるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるComponentUI.update(java.awt.Graphics, javax.swing.JComponent)protected void paintIcon(Graphics g, JComponent c, Rectangle iconRect)
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text)
protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text)
g - グラフィックス・コンテキストb - レンダリングする現在のボタンtextRect - テキストを描画する境界の矩形text - レンダリングする文字列protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)
protected void paintButtonPressed(Graphics g, AbstractButton b)
protected void clearTextShiftOffset()
protected void setTextShiftOffset()
protected int getTextShiftOffset()
public Dimension getMinimumSize(JComponent c)
ComponentUInullが返された場合、最小サイズは代わりにコンポーネントのレイアウト・マネージャによって計算されます(これは、特定のレイアウト・マネージャをインストールしてあるコンポーネントの場合に推奨する方法です)。 このメソッドのデフォルト実装はgetPreferredSizeを呼び出して、その値を返します。 getMinimumSize、クラスComponentUIc - 最小サイズが照会されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるDimensionオブジェクトまたはnullJComponent.getMinimumSize(), LayoutManager.minimumLayoutSize(java.awt.Container), ComponentUI.getPreferredSize(javax.swing.JComponent)public Dimension getPreferredSize(JComponent c)
ComponentUInullが返された場合、適切なサイズは代わりにコンポーネントのレイアウト・マネージャによって計算されます(これは、特定のレイアウト・マネージャをインストールしてあるコンポーネントの場合に推奨する方法です)。 このメソッドのデフォルト実装はnullを返します。 getPreferredSize、クラスComponentUIc - 推奨サイズが照会されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるJComponent.getPreferredSize(), LayoutManager.preferredLayoutSize(java.awt.Container)public Dimension getMaximumSize(JComponent c)
ComponentUInullが返された場合、最大サイズは代わりにコンポーネントのレイアウト・マネージャによって計算されます(これは、特定のレイアウト・マネージャをインストールしてあるコンポーネントの場合に推奨する方法です)。 このメソッドのデフォルト実装はgetPreferredSizeを呼び出して、その値を返します。 getMaximumSize、クラスComponentUIc - 最大サイズが照会されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがあるDimensionオブジェクトまたはnullJComponent.getMaximumSize(), LayoutManager2.maximumLayoutSize(java.awt.Container)public int getBaseline(JComponent c, int width, int height)
getBaseline、クラスComponentUIc - ベースラインが要求されるJComponentwidth - ベースラインを取得する幅height - ベースラインを取得する高さNullPointerException - cがnullである場合IllegalArgumentException - 幅または高さが0より小さい場合JComponent.getBaseline(int, int)public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
getBaselineResizeBehavior、クラスComponentUIc - ベースラインのサイズ変更の動作を返すJComponentNullPointerException - cがnullである場合JComponent.getBaseline(int, int) バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。