java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.OptionPaneUI
javax.swing.plaf.basic.BasicOptionPaneUI
- 直系の既知のサブクラス:
- SynthOptionPaneUI
public class BasicOptionPaneUI extends OptionPaneUI
JOptionPaneの基本Look & Feelを提供します。 BasicMessagePaneUIは、Containerにアイコン、メッセージ、およびボタンを配置する手段を提供します。 一般に、配置は次のようになります。 
 
        ------------------
        | i | message    |
        | c | message    |
        | o | message    |
        | n | message    |
        ------------------
        |     buttons    |
        |________________|
 
 アイコンは、JLabelの内部にラップされているIconのインスタンスです。 メッセージは不透明なオブジェクトで、次のようにテストされます: メッセージがComponentの場合、Containerに追加されています。Iconの場合、JLabelの内部にラップされてから、Containerに追加されています。それ以外の場合は、JLabelの内部にラップされています。 
 
 オプション・ペインのComponentOrientationプロパティが水平(左から右)のときは、上記の配置が使用されます。 ほかの方向の場合、配置は適切に調節されます。 
 
 Container、メッセージ、アイコン、およびボタンは、すべてabstractメソッドで決定されます。
- 
ネストされたクラスのサマリーネストされたクラス修飾子と型クラス説明classこのクラスは、「protected」内部クラスとして扱うようにしてください。static classButtonAreaLayoutは、FlowLayoutと同様に動作します。classこのクラスは、「protected」内部クラスとして扱うようにしてください。
- 
フィールドのサマリーフィールド修飾子と型フィールド説明protected booleanComponentがメッセージまたはボタンに含まれる場合に、validateComponentでtrueに設定されます。protected ComponentselectInitialValueでメッセージが送られたときに、フォーカスを受け取るコンポーネントです。protected JComponentoptionPane.getWantsInput()がtrueを返す場合に、JComponentが入力を用意します。static final intJOptionPaneの最小の高さ。protected DimensionJOptionPaneのサイズ。static final intJOptionPaneの最小幅。protected JOptionPaneレシーバがLook & Feelを提供しているJOptionPaneです。protected PropertyChangeListenerPropertyChangeListenerのインスタンス。
- 
コンストラクタのサマリーコンストラクタ
- 
メソッドのサマリー修飾子と型メソッド説明protected voidaddButtonComponents(Container container, Object[] buttons, int initialIndex) buttons内の各オブジェクトを表す適切なオブジェクトを作成し、それをcontainerに追加します。protected voidgetIconから返されたアイコンを表すJLabelを作成して、topに追加します。protected voidaddMessageComponents(Container container, GridBagConstraints cons, Object msg, int maxll, boolean internallyCreated) msgを表す適切なオブジェクトを作成し、それをcontainerに配置します。protected voidburstStringInto(Container c, String d, int maxll) dを表す新しいJLabelインスタンスを再帰的に作成します。booleanvalidateComponentへの直前の呼出しでメッセージまたはボタンがComponentのサブクラスを含んでいた場合に、trueを返します。protected ActionListenercreateButtonActionListener(int buttonIndex) ButtonActionListenerの新しいインスタンスを構築します。protected Containerボタンを含むContainerを作成して返します。protected LayoutManagerレイアウト・マネージャを返します。protected ContainerinstallComponentsからメッセージを送信して、メッセージの本文を含むContainerを作成します。protected PropertyChangeListenerPropertyChangeListenerのインスタンスを返します。protected Containerセパレータを返します。static ComponentUI新しいBasicOptionPaneUIインスタンスを作成します。protected Object[]レシーバがルック・アンド・フィールを提供しているJOptionPaneから表示するボタンを返します。protected IcongetIcon()レシーバがルック・アンド・フィールを提供しているJOptionPaneのアイコン、またはgetDefaultIconから返されたデフォルトのアイコンを返します。protected IcongetIconForType(int messageType) 渡されたタイプに使用するアイコンを返します。protected int選択するボタンへの初期インデックスを返します。protected int1行に配置する最大文字数を返します。protected Objectレシーバがルック・アンド・フィールを提供しているJOptionPaneから表示するメッセージを返します。オプション・ペインの最小サイズを返します。cが、レシーバが含まれるJOptionPaneである場合、返される推奨サイズはJOptionPaneのLayoutManagerの推奨サイズの最大値とgetMinimumOptionPaneSizeです。protected booleantrueを返します。基本的なL&Fでは、すべてのボタンの幅が同じになります。protected voidコンポーネントを登録します。protected voidデフォルトのプロパティをインストールします。protected voidキーボード操作を登録します。protected voidリスナーを登録します。void渡されたJOptionPaneのL&Fとしてレシーバをインストールします。protected voidレシーバがLook & Feelを提供しているオプション・ペイン内の入力値を、inputComponentの値を基にして設定します。voidinputComponentがnullでない場合、フォーカスがそれで要求されます。そうでない場合は、フォーカスをデフォルト値で要求します。protected voidコンポーネントの登録を解除します。protected void既定のプロパティをアンインストールします。protected voidキーボード操作の登録を解除します。protected voidリスナーを登録解除します。void渡された分割ペインのL&Fコントローラから、レシーバを削除します。クラスjavax.swing.plaf.ComponentUIで宣言されたメソッドcontains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, paint, update
- 
フィールド詳細- 
MinimumWidthpublic static final int MinimumWidthJOptionPaneの最小幅。- 関連項目:
 
- 
MinimumHeightpublic static final int MinimumHeightJOptionPaneの最小の高さ。- 関連項目:
 
- 
optionPaneprotected JOptionPane optionPaneレシーバがLook & Feelを提供しているJOptionPaneです。
- 
minimumSizeprotected Dimension minimumSizeJOptionPaneのサイズ。
- 
inputComponentprotected JComponent inputComponentoptionPane.getWantsInput()がtrueを返す場合に、JComponentが入力を用意します。
- 
initialFocusComponentprotected Component initialFocusComponentselectInitialValueでメッセージが送られたときに、フォーカスを受け取るコンポーネントです。
- 
hasCustomComponentsprotected boolean hasCustomComponentsComponentがメッセージまたはボタンに含まれる場合に、validateComponentでtrueに設定されます。
- 
propertyChangeListenerprotected PropertyChangeListener propertyChangeListenerPropertyChangeListenerのインスタンス。
 
- 
- 
コンストラクタの詳細- 
BasicOptionPaneUIpublic BasicOptionPaneUI()BasicOptionPaneUIを構築します。
 
- 
- 
メソッドの詳細- 
createUIpublic static ComponentUI createUI(JComponent x) 新しいBasicOptionPaneUIインスタンスを作成します。- パラメータ:
- x- コンポーネント
- 戻り値:
- 新しいBasicOptionPaneUIインスタンス
 
- 
installUIpublic void installUI(JComponent c) 渡されたJOptionPaneのL&Fとしてレシーバをインストールします。- オーバーライド:
- installUI、クラス- ComponentUI
- パラメータ:
- c- UI委譲がインストールされるコンポーネント
- 関連項目:
 
- 
uninstallUIpublic void uninstallUI(JComponent c) 渡された分割ペインのL&Fコントローラから、レシーバを削除します。- オーバーライド:
- uninstallUI、クラス- ComponentUI
- パラメータ:
- c- このUI委譲が削除されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある
- 関連項目:
 
- 
installDefaultsprotected void installDefaults()デフォルトのプロパティをインストールします。
- 
uninstallDefaultsprotected void uninstallDefaults()既定のプロパティをアンインストールします。
- 
installComponentsprotected void installComponents()コンポーネントを登録します。
- 
uninstallComponentsprotected void uninstallComponents()コンポーネントの登録を解除します。
- 
createLayoutManagerprotected LayoutManager createLayoutManager()レイアウト・マネージャを返します。- 戻り値:
- レイアウト・マネージャ
 
- 
installListenersprotected void installListeners()リスナーを登録します。
- 
uninstallListenersprotected void uninstallListeners()リスナーを登録解除します。
- 
createPropertyChangeListenerprotected PropertyChangeListener createPropertyChangeListener()PropertyChangeListenerのインスタンスを返します。- 戻り値:
- PropertyChangeListenerのインスタンス
 
- 
installKeyboardActionsprotected void installKeyboardActions()キーボード操作を登録します。
- 
uninstallKeyboardActionsprotected void uninstallKeyboardActions()キーボード操作の登録を解除します。
- 
getMinimumOptionPaneSizepublic Dimension getMinimumOptionPaneSize()オプション・ペインの最小サイズを返します。 主に、異なる最小サイズを提供しようとするサブクラスのために提供されています。- 戻り値:
- オプション・ペインの最小サイズ
 
- 
getPreferredSizepublic Dimension getPreferredSize(JComponent c) cが、レシーバが含まれるJOptionPaneである場合、返される推奨サイズはJOptionPaneのLayoutManagerの推奨サイズの最大値とgetMinimumOptionPaneSizeです。- オーバーライド:
- getPreferredSize、クラス- ComponentUI
- パラメータ:
- c- 適切なサイズが照会されるコンポーネント。この引数は通常無視されるが、UIオブジェクトがステートレスで、複数のコンポーネントで共有されている場合は使用されることがある
- 戻り値:
- ルック・アンド・フィールに適した特定のコンポーネントの優先サイズを含むDimensionオブジェクト
- 関連項目:
 
- 
createMessageAreaprotected Container createMessageArea()installComponentsからメッセージを送信して、メッセージの本文を含むContainerを作成します。 アイコンは、addIconを呼び出すことにより作成されます。- 戻り値:
- Containerのインスタンス
 
- 
addMessageComponentsprotected void addMessageComponents(Container container, GridBagConstraints cons, Object msg, int maxll, boolean internallyCreated) msgを表す適切なオブジェクトを作成し、それをcontainerに配置します。msgがComponentのインスタンスである場合は、直接追加されます。Iconの場合は、JLabelが作成され、それ以外の場合は文字列にJLabelが作成されます。msgがObject []の場合、このメソッドは子に対して再帰的に呼び出されます。msgがComponentのインスタンスであり、このメソッド(これは、internallyCreatedがfalseの場合にのみhasCustomComponentsを正しく設定するために使用されます)によって内部的に作成された場合、internallyCreatedはtrueです。- パラメータ:
- container- コンテナ
- cons-- GridBagConstraintsのインスタンス
- msg- メッセージ
- maxll- 最大長
- internallyCreated- コンポーネントが内部的に作成された場合は- true
 
- 
getMessageprotected Object getMessage()レシーバがルック・アンド・フィールを提供しているJOptionPaneから表示するメッセージを返します。- 戻り値:
- 表示するメッセージ
 
- 
addIconprotected void addIcon(Container top) getIconから返されたアイコンを表すJLabelを作成して、topに追加します。 これは、createMessageAreaからメッセージとして送られます。- パラメータ:
- top- コンテナ
 
- 
getIconprotected Icon getIcon()レシーバがルック・アンド・フィールを提供しているJOptionPaneのアイコン、またはgetDefaultIconから返されたデフォルトのアイコンを返します。- 戻り値:
- アイコン
 
- 
getIconForTypeprotected Icon getIconForType(int messageType) 渡されたタイプに使用するアイコンを返します。- パラメータ:
- messageType- メッセージの一種
- 戻り値:
- 渡された型に使用するアイコン
 
- 
getMaxCharactersPerLineCountprotected int getMaxCharactersPerLineCount()1行に配置する最大文字数を返します。- 戻り値:
- 1行に配置する最大文字数
 
- 
burstStringIntodを表す新しいJLabelインスタンスを再帰的に作成します。 各JLabelインスタンスがcに追加されます。- パラメータ:
- c- コンテナ
- d- テキスト
- maxll- テキストの最大長
 
- 
createSeparatorprotected Container createSeparator()セパレータを返します。- 戻り値:
- セパレータ
 
- 
createButtonAreaprotected Container createButtonArea()ボタンを含むContainerを作成して返します。 ボタンは、getButtonsの呼出しにより作成されます。- 戻り値:
- ボタンを含むContainer
 
- 
addButtonComponentsbuttons内の各オブジェクトを表す適切なオブジェクトを作成し、それをcontainerに追加します。 addMessageComponentsとの違いは、buttonsを再帰的に扱うことと、ボタンがComponentでない場合にJButtonのインスタンスを作成することです。- パラメータ:
- container- コンテナ
- buttons- ボタンの配列
- initialIndex- 初期インデックス
 
- 
createButtonActionListenerprotected ActionListener createButtonActionListener(int buttonIndex) ButtonActionListenerの新しいインスタンスを構築します。- パラメータ:
- buttonIndex- ボタンのインデックス
- 戻り値:
- ButtonActionListenerの新しいインスタンス
 
- 
getButtonsprotected Object[] getButtons()レシーバがルック・アンド・フィールを提供しているJOptionPaneから表示するボタンを返します。JOptionPaneにオプションが設定されている場合は、オプションが指定されます。それ以外の場合は、optionTypeがYES_NO_OPTIONの場合、yesNoOptionsが返され、型がYES_NO_CANCEL_OPTIONyesNoCancelOptionsの場合、それ以外の場合はdefaultButtonsが返されます。- 戻り値:
- JOptionPaneから表示するボタン
 
- 
getSizeButtonsToSameWidthprotected boolean getSizeButtonsToSameWidth()trueを返します。基本的なL&Fでは、すべてのボタンの幅が同じになります。- 戻り値:
- trueすべてのボタンの幅が同じである必要がある場合
 
- 
getInitialValueIndexprotected int getInitialValueIndex()選択するボタンへの初期インデックスを返します。 このインデックスはJOptionPaneおよびJOptionPaneの各オプションからの初期値から計算されるか、または0です。- 戻り値:
- 選択するボタンの最初のインデックス
 
- 
resetInputValueprotected void resetInputValue()レシーバがLook & Feelを提供しているオプション・ペイン内の入力値を、inputComponentの値を基にして設定します。
- 
selectInitialValuepublic void selectInitialValue(JOptionPane op) inputComponentがnullでない場合、フォーカスがそれで要求されます。そうでない場合は、フォーカスをデフォルト値で要求します。- 定義:
- selectInitialValue、クラス- OptionPaneUI
- パラメータ:
- op- a- JOptionPane
 
- 
containsCustomComponentspublic boolean containsCustomComponents(JOptionPane op) validateComponentへの直前の呼出しでメッセージまたはボタンがComponentのサブクラスを含んでいた場合に、trueを返します。- 定義:
- containsCustomComponents、クラス- OptionPaneUI
- パラメータ:
- op- a- JOptionPane
- 戻り値:
- 指定されたJOptionPaneに、ユーザーが作成したComponentが含まれている場合はtrue
 
 
-