javax.swing.plaf.basic

Class BasicSpinnerUI

public class BasicSpinnerUI extends SpinnerUI

A UI delegate for the {@link JSpinner} component.

Since: 1.4

Field Summary
protected JSpinnerspinner
The spinner for this UI
Method Summary
protected JComponentcreateEditor()
Creates an editor component.
protected LayoutManagercreateLayout()
Creates a LayoutManager that layouts the sub components.
protected ComponentcreateNextButton()
Creates the "Next" button
protected ComponentcreatePreviousButton()
Creates the "Previous" button
protected PropertyChangeListenercreatePropertyChangeListener()
Creates the PropertyChangeListener that will be attached by installListeners.
static ComponentUIcreateUI(JComponent c)
Creates a new BasicSpinnerUI for the specified JComponent
protected voidinstallDefaults()
Called by installUI.
protected voidinstallListeners()
protected voidinstallNextButtonListeners(Component c)
protected voidinstallPreviousButtonListeners(Component c)
voidinstallUI(JComponent c)
Install this UI to the JComponent, which in reality, is a JSpinner.
protected voidreplaceEditor(JComponent oldEditor, JComponent newEditor)
Replace the old editor with the new one
protected voiduninstallDefaults()
The reverse of installDefaults.
protected voiduninstallListeners()
The reverse of installListeners, called by uninstallUI
voiduninstallUI(JComponent c)
Called when the current L&F is replaced with another one, should call uninstallDefaults and uninstallListeners as well as remove the next/previous buttons and the editor

Field Detail

spinner

protected JSpinner spinner
The spinner for this UI

Method Detail

createEditor

protected JComponent createEditor()
Creates an editor component. Really, it just returns JSpinner.getEditor()

Returns: a JComponent as an editor

See Also: JSpinner

createLayout

protected LayoutManager createLayout()
Creates a LayoutManager that layouts the sub components. The subcomponents are identifies by the constraint "Next", "Previous" and "Editor"

Returns: a LayoutManager

See Also: LayoutManager

createNextButton

protected Component createNextButton()
Creates the "Next" button

Returns: the next button component

createPreviousButton

protected Component createPreviousButton()
Creates the "Previous" button

Returns: the previous button component

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener()
Creates the PropertyChangeListener that will be attached by installListeners. It should watch for the "editor" property, when it's changed, replace the old editor with the new one, probably by calling replaceEditor

Returns: a PropertyChangeListener

See Also: BasicSpinnerUI

createUI

public static ComponentUI createUI(JComponent c)
Creates a new BasicSpinnerUI for the specified JComponent

Parameters: c the component (ignored).

Returns: A new instance of {@link BasicSpinnerUI}.

installDefaults

protected void installDefaults()
Called by installUI. This should set various defaults obtained from UIManager.getLookAndFeelDefaults, as well as set the layout obtained from createLayout

See Also: UIManager BasicSpinnerUI BasicSpinnerUI

installListeners

protected void installListeners()

installNextButtonListeners

protected void installNextButtonListeners(Component c)

installPreviousButtonListeners

protected void installPreviousButtonListeners(Component c)

installUI

public void installUI(JComponent c)
Install this UI to the JComponent, which in reality, is a JSpinner. Calls installDefaults, installListeners, and also adds the buttons and editor.

Parameters: c DOCUMENT ME!

See Also: BasicSpinnerUI BasicSpinnerUI BasicSpinnerUI BasicSpinnerUI BasicSpinnerUI

replaceEditor

protected void replaceEditor(JComponent oldEditor, JComponent newEditor)
Replace the old editor with the new one

Parameters: oldEditor the old editor newEditor the new one to replace with

uninstallDefaults

protected void uninstallDefaults()
The reverse of installDefaults. Called by uninstallUI

uninstallListeners

protected void uninstallListeners()
The reverse of installListeners, called by uninstallUI

uninstallUI

public void uninstallUI(JComponent c)
Called when the current L&F is replaced with another one, should call uninstallDefaults and uninstallListeners as well as remove the next/previous buttons and the editor

Parameters: c DOCUMENT ME!