- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.SpinnerUI
-
- javax.swing.plaf.basic.BasicSpinnerUI
-
- javax.swing.plaf.synth.SynthSpinnerUI
-
- すべての実装されたインタフェース:
PropertyChangeListener,EventListener,SynthConstants,SynthUI
public class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, SynthUI
JSpinnerのSynth L&F UIの委譲を提供します。- 導入されたバージョン:
- 1.7
-
-
フィールドのサマリー
-
クラス javax.swing.plaf.basic.BasicSpinnerUIから継承されたフィールド
spinner
-
インタフェース javax.swing.plaf.synth.SynthConstantsから継承されたフィールド
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
-
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 SynthSpinnerUI()
-
メソッドのサマリー
すべてのメソッド 静的メソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 protected JComponentcreateEditor()このメソッドはinstallUIにより呼び出され、JSpinnerのエディタ・コンポーネントを取得します。protected LayoutManagercreateLayout()JSpinnerの子であるeditor、nextButton、およびpreviousButtonを管理するLayoutManagerを作成します。protected ComponentcreateNextButton()増分ボタン、つまりスピナー値をspinner.getNextValueによって返されたオブジェクトで置き換えるコンポーネントを作成します。protected ComponentcreatePreviousButton()減分ボタン、つまりスピナー値をspinner.getPreviousValueによって返されたオブジェクトで置き換えるコンポーネントを作成します。static ComponentUIcreateUI(JComponent c)SynthSpinnerUIの新しいインスタンスを返します。SynthContextgetContext(JComponent c)指定されたコンポーネントのコンテキストを返します。protected voidinstallDefaults()デフォルト・テーブルの対応する「Spinner.*」プロパティに基づくプロパティJSpinner、border、foreground、およびbackgroundを初期化します。protected voidinstallListeners()対象のPropertyChangeEventをprotectedメソッドに委譲する共用オブジェクトで、PropertyChangeListenerを初期化します。voidpaint(Graphics g, JComponent c)Look & Feelに従って、指定されたコンポーネントをペイントします。protected voidpaint(SynthContext context, Graphics g)指定されたコンポーネントをペイントします。voidpaintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)ボーダーをペイントします。voidpropertyChange(PropertyChangeEvent e)バウンド・プロパティの変更時に呼び出されます。protected voidreplaceEditor(JComponent oldEditor, JComponent newEditor)JSpinnerエディタ・プロパティに変更があるときに、PropertyChangeListenerにより呼び出されます。protected voiduninstallDefaults()JSpinner'sのレイアウト・マネージャをnullに設定します。protected voiduninstallListeners()installListenerによって追加されたPropertyChangeListenerを削除します。voidupdate(Graphics g, JComponent c)このUI委譲に、指定されたコンポーネントを再ペイントするよう通知します。-
クラス javax.swing.plaf.basic.BasicSpinnerUIから継承されたメソッド
createPropertyChangeListener, getBaseline, getBaselineResizeBehavior, installKeyboardActions, installNextButtonListeners, installPreviousButtonListeners, installUI, uninstallUI
-
クラス javax.swing.plaf.ComponentUIから継承されたメソッド
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize
-
-
-
-
メソッドの詳細
-
createUI
public static ComponentUI createUI(JComponent c)
SynthSpinnerUIの新しいインスタンスを返します。- パラメータ:
c- JSpinner (未使用)- 戻り値:
- 新しいSynthSpinnerUIオブジェクト
- 関連項目:
ComponentUI.createUI(javax.swing.JComponent)
-
installListeners
protected void installListeners()
対象のPropertyChangeEventをprotectedメソッドに委譲する共用オブジェクトで、PropertyChangeListenerを初期化します。このメソッドは
installUIにより呼び出されます。
-
uninstallListeners
protected void uninstallListeners()
installListenerによって追加されたPropertyChangeListenerを削除します。このメソッドは
uninstallUIにより呼び出されます。- オーバーライド:
uninstallListeners、クラス:BasicSpinnerUI- 関連項目:
BasicSpinnerUI.installListeners()
-
installDefaults
protected void installDefaults()
デフォルト・テーブルの対応する「Spinner.*」プロパティに基づくプロパティJSpinner、border、foreground、およびbackgroundを初期化します。JSpinnersレイアウトは、createLayoutが返す値に設定されます。 このメソッドはinstallUIにより呼び出されます。
-
uninstallDefaults
protected void uninstallDefaults()
JSpinner'sのレイアウト・マネージャをnullに設定します。 このメソッドはuninstallUIにより呼び出されます。
-
createLayout
protected LayoutManager createLayout()
JSpinnerの子であるeditor、nextButton、およびpreviousButtonを管理するLayoutManagerを作成します。 これらの3つの子は、それらの役割(「エディタ」、「次」、および「前」)を識別する制約と一緒に追加される必要があります。 デフォルトのレイアウト・マネージャは、これらの子のいずれかが欠けている場合にも対処できます。- オーバーライド:
createLayout、クラス:BasicSpinnerUI- 戻り値:
- 「エディタ」、「次」ボタン、および「前」ボタンのためのLayoutManager。
- 関連項目:
BasicSpinnerUI.createNextButton(),BasicSpinnerUI.createPreviousButton(),BasicSpinnerUI.createEditor()
-
createPreviousButton
protected Component createPreviousButton()
減分ボタン、つまりスピナー値をspinner.getPreviousValueによって返されたオブジェクトで置き換えるコンポーネントを作成します。 デフォルトでは、previousButtonはJButtonです。 減分ボタンが必要ない場合、このメソッドはnullを返すべきです。- オーバーライド:
createPreviousButton、クラス:BasicSpinnerUI- 戻り値:
- スピナーの値を、シーケンス内の前の値で置き換えるコンポーネント、または
null - 関連項目:
BasicSpinnerUI.installUI(javax.swing.JComponent),BasicSpinnerUI.createNextButton(),BasicSpinnerUI.installPreviousButtonListeners(java.awt.Component)
-
createNextButton
protected Component createNextButton()
増分ボタン、つまりスピナー値をspinner.getNextValueによって返されたオブジェクトで置き換えるコンポーネントを作成します。 デフォルトでは、nextButtonはJButtonです。 増分ボタンが必要ない場合、このメソッドはnullを返すべきです。- オーバーライド:
createNextButton、クラス:BasicSpinnerUI- 戻り値:
- スピナーの値を、シーケンス内の次の値で置き換えるコンポーネント、または
null - 関連項目:
BasicSpinnerUI.installUI(javax.swing.JComponent),BasicSpinnerUI.createPreviousButton(),BasicSpinnerUI.installNextButtonListeners(java.awt.Component)
-
createEditor
protected JComponent createEditor()
このメソッドはinstallUIにより呼び出され、JSpinnerのエディタ・コンポーネントを取得します。 デフォルトでは、JSpinner.getEditor()を返すだけです。 サブクラスは、スピナーのエディタを含むコンポーネントまたはnull (JSpinnerへのエディタの追加をinstallUIオーバーライドで処理する場合)を返すために、createEditorをオーバーライドできます。このメソッドは通常、カスタム・ボーダーを含むコンテナでエディタをラップするためにオーバーライドされます(エディタ・ボーダーを直接設定できることは想定できないため)。
スピナー・エディタが
JSpinner.setEditorで変更されるときは、replaceEditorメソッドが呼び出されます。 このメソッドをオーバーライドした場合、同様にreplaceEditorをオーバーライドすることをお勧めします。- オーバーライド:
createEditor、クラス:BasicSpinnerUI- 戻り値:
- デフォルトで、JSpinnersエディタJComponent、spinner.getEditor()
- 関連項目:
BasicSpinnerUI.installUI(javax.swing.JComponent),replaceEditor(javax.swing.JComponent, javax.swing.JComponent),JSpinner.getEditor()
-
replaceEditor
protected void replaceEditor(JComponent oldEditor, JComponent newEditor)
JSpinnerエディタ・プロパティに変更があるときに、PropertyChangeListenerにより呼び出されます。 古いエディタを削除し、新しいエディタを追加するのは、このメソッドの役割です。 デフォルトでは、この操作は次のようになります。spinner.remove(oldEditor); spinner.add(newEditor, "Editor");
replaceEditorの実装は、createEditorメソッドと調整するようにしてください。- オーバーライド:
replaceEditor、クラス:BasicSpinnerUI- パラメータ:
oldEditor- エディタの古いインスタンスnewEditor- エディタの新しいインスタンス- 関連項目:
createEditor(),BasicSpinnerUI.createPropertyChangeListener()
-
getContext
public SynthContext getContext(JComponent c)
指定されたコンポーネントのコンテキストを返します。- 定義:
getContext、インタフェース:SynthUI- パラメータ:
c- SynthContextを要求するコンポーネント。- 戻り値:
- コンポーネントを記述するSynthContext。
-
update
public void update(Graphics g, JComponent c)
このUI委譲に、指定されたコンポーネントを再ペイントするよう通知します。 このメソッドはコンポーネントのバックグラウンドをペイントし、paint(SynthContext,Graphics)メソッドを呼び出します。一般に、このメソッドはサブクラスによってオーバーライドする必要はありません。 すべてのLook & Feelの描画コードを
paintメソッドに入れるようにしてください。- オーバーライド:
update、クラス:ComponentUI- パラメータ:
g- ペイントに使用されるGraphicsオブジェクトc- ペイントされるコンポーネント- 関連項目:
paint(SynthContext,Graphics)
-
paint
public void paint(Graphics g, JComponent c)
Look & Feelに従って、指定されたコンポーネントをペイントします。このメソッドは、Synth Look & Feelで使用されません。 ペイントは
paint(SynthContext,Graphics)メソッドによって処理されます。- オーバーライド:
paint、クラス:ComponentUI- パラメータ:
g- ペイントに使用されるGraphicsオブジェクトc- ペイントされるコンポーネント- 関連項目:
paint(SynthContext,Graphics)
-
paint
protected void paint(SynthContext context, Graphics g)
指定されたコンポーネントをペイントします。 この実装は処理を行いません。- パラメータ:
context- ペイントされるコンポーネントのコンテキストg- ペイントに使用されるGraphicsオブジェクト- 関連項目:
update(Graphics,JComponent)
-
paintBorder
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
ボーダーをペイントします。- 定義:
paintBorder、インタフェース:SynthUI- パラメータ:
context- コンポーネント・コンテキストg- ペイントされるGraphicsx- X座標y- Y座標w- ボーダーの幅h- ボーダーの高さ
-
propertyChange
public void propertyChange(PropertyChangeEvent e)
バウンド・プロパティの変更時に呼び出されます。- 定義:
propertyChange、インタフェース:PropertyChangeListener- パラメータ:
e- イベント・ソースと変更されたプロパティを記述したPropertyChangeEventオブジェクト。
-
-