|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.SpinnerUI
javax.swing.plaf.basic.BasicSpinnerUI
public class BasicSpinnerUI
デフォルトの Spinner UI の委譲です。
| フィールドの概要 | |
|---|---|
protected JSpinner |
spinner
UI 委譲のためのスピナです。 |
| コンストラクタの概要 | |
|---|---|
BasicSpinnerUI()
|
|
| メソッドの概要 | |
|---|---|
protected JComponent |
createEditor()
このメソッドは installUI により呼び出され、 JSpinnerのエディタコンポーネントを取得します。 |
protected LayoutManager |
createLayout()
JSpinner の子である editor、nextButton、および previousButtonを
管理する LayoutManagerを作成します。 |
protected Component |
createNextButton()
スピナモデル値を spinner.getNextValueが返すオブジェクトに置き換えるコンポーネントを作成しま
す。 |
protected Component |
createPreviousButton()
スピナモデル値を spinner.getPreviousValueが返すオブジェクトに置き換えるコンポーネントを作成
します。 |
protected PropertyChangeListener |
createPropertyChangeListener()
JSpinner 自体に追加できる PropertyChangeListenerを作成します。 |
static ComponentUI |
createUI(JComponent c)
BasicSpinnerUI の新しいインスタンスを返します。 |
protected void |
installDefaults()
デフォルトテーブルの対応する Spinner.* プロパティに基づくプロパティ JSpinnerborder、foreground、
および backgroundを初期化します。 |
protected void |
installKeyboardActions()
キーボードアクションを JSpinner にインストールします。 |
protected void |
installListeners()
対象の PropertyChangeEvents を protected メソッドに委譲する共用オブジェクトで、 PropertyChangeListenerを
初期化します。 |
protected void |
installNextButtonListeners(Component c)
ユーザのジェスチャーに対応して JSpinnerを更新するために、必要なリスナーを [次の項目] ボタン cに
インストールします。 |
protected void |
installPreviousButtonListeners(Component c)
ユーザのジェスチャーに対応して JSpinnerを更新するために、必要なリスナーを [前の項目] ボタン cに
インストールします。 |
void |
installUI(JComponent c)
installDefaultsと installListenersを呼び出し、createNextButton、createPreviousButton、
および createEditorが返したコンポーネントを追加します。 |
protected void |
replaceEditor(JComponent oldEditor,
JComponent newEditor)
JSpinnerエディタプロパティに変更がある場合、PropertyChangeListenerに
より呼び出されます。 |
protected void |
uninstallDefaults()
JSpinner のレイアウトマネージャを null に設定します。 |
protected void |
uninstallListeners()
installListeners が追加した PropertyChangeListenerを削除します。 |
void |
uninstallUI(JComponent c)
uninstallDefaultsと uninstallListenersを呼び出し、ス
ピナの子をすべて削除します。 |
| クラス javax.swing.plaf.ComponentUI から継承されたメソッド |
|---|
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, paint, update |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected JSpinner spinner
installUIメソッドで初期化され、uninstallUIで
null にリセットされます。
installUI(javax.swing.JComponent),
uninstallUI(javax.swing.JComponent)| コンストラクタの詳細 |
|---|
public BasicSpinnerUI()
| メソッドの詳細 |
|---|
public static ComponentUI createUI(JComponent c)
c - JSpinner
(未使用)
ComponentUI.createUI(javax.swing.JComponent)public void installUI(JComponent c)
installDefaultsと installListenersを呼び出し、createNextButton、createPreviousButton、
および createEditorが返したコンポーネントを追加します。
ComponentUI 内の installUIc - JSpinnerinstallDefaults(),
installListeners(),
createNextButton(),
createPreviousButton(),
createEditor()public void uninstallUI(JComponent c)
uninstallDefaultsと uninstallListenersを呼び出し、ス
ピナの子をすべて削除します。
ComponentUI 内の uninstallUIc - JSpinner
(未使用)ComponentUI.installUI(javax.swing.JComponent),
JComponent.updateUI()protected void installListeners()
PropertyChangeListenerを
初期化します。
このメソッドは installUI によって呼び出されます。
replaceEditor(javax.swing.JComponent, javax.swing.JComponent),
uninstallListeners()protected void uninstallListeners()
PropertyChangeListenerを削除します。
このメソッドは uninstallUI によって呼び出されます。
installListeners()protected void installDefaults()
JSpinnerborder、foreground、
および backgroundを初期化します。JSpinnersの配置は、createLayoutが
返す値に設定されます。このメソッドは、installUIにより呼び出されます。
uninstallDefaults(),
installUI(javax.swing.JComponent),
createLayout(),
LookAndFeel.installBorder(javax.swing.JComponent, java.lang.String),
LookAndFeel.installColors(javax.swing.JComponent, java.lang.String, java.lang.String)protected void uninstallDefaults()
JSpinner のレイアウトマネージャを null に設定します。このメソッドは、uninstallUIに
より呼び出されます。
installDefaults(),
uninstallUI(javax.swing.JComponent)protected void installNextButtonListeners(Component c)
JSpinnerを更新するために、必要なリスナーを [次の項目] ボタン cに
インストールします。
c - リスナーのインス
トール先のコンポーネント
NullPointerException - c
が null の場合createNextButton()protected void installPreviousButtonListeners(Component c)
JSpinnerを更新するために、必要なリスナーを [前の項目] ボタン cに
インストールします。
c - リスナーのインス
トール先のコンポーネント
NullPointerException - c
が null の場合createPreviousButton()protected LayoutManager createLayout()
editor、nextButton、および previousButtonを
管理する LayoutManagerを作成します。この 3 つの子には、各自の役割を
Editor、Next、および Previous と特定する制約を追加する必要があります。
createNextButton(),
createPreviousButton(),
createEditor()protected PropertyChangeListener createPropertyChangeListener()
PropertyChangeListenerを作成します。通常、エディタプロパ
ティの変更がある場合、このリスナーは replaceEditor を呼び出します。エディタを JSpinner
に追加し、古いエディタを削除するのは、SpinnerUIの役割であるためです。このメソッドは、installListenersに
より呼び出されます。
installListeners()protected Component createPreviousButton()
spinner.getPreviousValueが返すオブジェクトに置き換えるコンポーネントを作成
します。デフォルトでは、previousButtonは JButton
です。このメソッドは、ユーザのジェスチャーに対応して JSpinnerのモデルを更新するために、installPreviousButtonListenersを
呼び出して必要なリスナーをインストールします。previousButton がサブクラスには不要な場合、null
を返すためにこのメソッドはオーバーライドされます。
installUI(javax.swing.JComponent),
createNextButton(),
installPreviousButtonListeners(java.awt.Component)protected Component createNextButton()
spinner.getNextValueが返すオブジェクトに置き換えるコンポーネントを作成しま
す。デフォルトでは、nextButtonは JButton で、その ActionListenerは
それ自体の JSpinner上位モデルを更新します。nextButton がサブクラスに必要でない場合、null
を返すためにこのメソッドはオーバーライドされます。
installUI(javax.swing.JComponent),
createPreviousButton(),
installNextButtonListeners(java.awt.Component)protected JComponent createEditor()
JSpinnerのエディタコンポーネントを取得します。デフォル
トでは、JSpinner.getEditor()を返すだけです。サブクラスが installUIを
オーバーライドして、JSpinnerへのエディタの追加処理をする場合、サブクラスは createEditorを
オーバーライドして、スピナのエディタを含むコンポーネント、または null を返すことができます。
エディタのボーダを直接設定できないため、通常、このメソッドはオーバーライドされ、カスタムボーダを持つコンテナでエディタをラップしま す。
スピナエディタが JSpinner.setEditor で変更される場合、replaceEditor
メソッドが呼び出されます。このメソッドをオーバーライドした場合、同様に replaceEditor
をオーバーライドできます。
installUI(javax.swing.JComponent),
replaceEditor(javax.swing.JComponent, javax.swing.JComponent),
JSpinner.getEditor()
protected void replaceEditor(JComponent oldEditor,
JComponent newEditor)
JSpinnerエディタプロパティに変更がある場合、PropertyChangeListenerに
より呼び出されます。古いエディタを削除し、新しいエディタを追加するのは、このメソッドの役割です。デフォルトでは、この操作は次のようになります。
spinner.remove(oldEditor);
spinner.add(newEditor, "Editor");
replaceEditorの実装は、createEditorメソッドと調整する必要がありま
す。
createEditor(),
createPropertyChangeListener()protected void installKeyboardActions()
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。