| Modifier and Type | Class and Description |
|---|---|
| private static class | BasicSpinnerUI.
A handler for spinner arrow button mouse and action events. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private BasicSpinnerUI. | |
| private static final BasicSpinnerUI. | nextButtonHandler
The mouse/action listeners that are added to the spinner's arrow buttons. |
| private static final BasicSpinnerUI. | |
| private PropertyChangeListener | |
| protected JSpinner | spinner
The spinner that we're a UI delegate for. |
| private static final Dimension | zeroSize
Used by the default LayoutManager class - SpinnerLayout for missing (null) editor/nextButton/previousButton children. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Component | |
| protected JComponent | Returns: the JSpinners editor JComponent, spinner.getEditor() by defaultThis method is called by installUI to get the editor component
of the |
| protected LayoutManager | Returns: a LayoutManager for the editor, next button, and previous button.Creates a |
| protected Component | Returns: a component that will replace the spinner's value with the next value in the sequence, ornullCreates an increment button, i.e. component that replaces the spinner
value with the object returned by |
| protected Component | Returns: a component that will replace the spinner's value with the previous value in the sequence, ornullCreates a decrement button, i.e. component that replaces the spinner
value with the object returned by |
| protected PropertyChangeListener | Returns: A PropertyChangeListener for the JSpinner itselfCreates a |
| public static ComponentUI | Returns: a new BasicSpinnerUI objectthe JSpinner (not used) c)Hides javax. Returns a new instance of BasicSpinnerUI. |
| public int | getBaseline(JComponent c, int width, int height)
Overrides javax. Returns the baseline. |
| public Component. | getBaselineResizeBehavior(JComponent c)
Overrides javax. Returns an enum indicating how the baseline of the component changes as the size changes. |
| private BasicSpinnerUI. | |
| private InputMap | |
| private void | |
| protected void | installDefaults()
Initialize the |
| private void | installEditorBorderListener(JComponent editor)
Remove the border around the inner editor component for LaFs that install an outside border around the spinner, |
| protected void | |
| protected void | installListeners()
Initializes |
| protected void | installNextButtonListeners(Component
Component to install the listeners on c)Installs the necessary listeners on the next button, |
| protected void | installPreviousButtonListeners(Component
Component to install the listeners on. c)Installs the necessary listeners on the previous button, |
| public void | installUI(JComponent
the JSpinner c)Overrides javax. Calls |
| pack-priv static void | |
| private void | |
| private void | maybeRemoveEditorBorder(JComponent editor)
Remove the border around the inner editor component for LaFs that install an outside border around the spinner, |
| private void | |
| protected void | replaceEditor(JComponent
an old instance of editor oldEditor, JComponent a new instance of editor newEditor)Called by the |
| protected void | |
| protected void | |
| public void | uninstallUI(JComponent
the JSpinner (not used) c)Overrides javax. Calls |
| private void | |
| private void | updateEnabledState()
Updates the enabled state of the children Components based on the
enabled state of the |
| private void | updateEnabledState(Container c, boolean enabled)
Recursively updates the enabled state of the child
|
| handler | back to summary |
|---|---|
| private BasicSpinnerUI. | |
| nextButtonHandler | back to summary |
|---|---|
| private static final BasicSpinnerUI. The mouse/action listeners that are added to the spinner's arrow buttons. These listeners are shared by all spinner arrow buttons.
| |
| previousButtonHandler | back to summary |
|---|---|
| private static final BasicSpinnerUI. | |
| propertyChangeListener | back to summary |
|---|---|
| private PropertyChangeListener propertyChangeListener | |
| spinner | back to summary |
|---|---|
| protected JSpinner spinner The spinner that we're a UI delegate for. Initialized by
the
| |
| zeroSize | back to summary |
|---|---|
| private static final Dimension zeroSize Used by the default LayoutManager class - SpinnerLayout for missing (null) editor/nextButton/previousButton children. | |
| BasicSpinnerUI | back to summary |
|---|---|
| public BasicSpinnerUI() Constructs a | |
| createArrowButton | back to summary |
|---|---|
| private Component createArrowButton(int direction) | |
| createEditor | back to summary |
|---|---|
| protected JComponent createEditor() This method is called by installUI to get the editor component
of the Typically this method would be overridden to wrap the editor with a container with a custom border, since one can't assume that the editors border can be set directly.
The
| |
| createLayout | back to summary |
|---|---|
| protected LayoutManager createLayout() Creates a
| |
| createNextButton | back to summary |
|---|---|
| protected Component createNextButton() Creates an increment button, i.e. component that replaces the spinner
value with the object returned by
| |
| createPreviousButton | back to summary |
|---|---|
| protected Component createPreviousButton() Creates a decrement button, i.e. component that replaces the spinner
value with the object returned by
| |
| createPropertyChangeListener | back to summary |
|---|---|
| protected PropertyChangeListener createPropertyChangeListener() Creates a
| |
| createUI | back to summary |
|---|---|
| public static ComponentUI createUI(JComponent c) Hides javax. Returns a new instance of BasicSpinnerUI. SpinnerListUI delegates are allocated one per JSpinner.
| |
| getBaseline | back to summary |
|---|---|
| public int getBaseline(JComponent c, int width, int height) Overrides javax. Returns the baseline.
| |
| getBaselineResizeBehavior | back to summary |
|---|---|
| public Component. Overrides javax. Returns an enum indicating how the baseline of the component changes as the size changes.
| |
| getHandler | back to summary |
|---|---|
| private BasicSpinnerUI. | |
| getInputMap | back to summary |
|---|---|
| private InputMap getInputMap(int condition) Returns the InputMap to install for | |
| installButtonListeners | back to summary |
|---|---|
| private void installButtonListeners(Component c, BasicSpinnerUI. | |
| installDefaults | back to summary |
|---|---|
| protected void installDefaults() Initialize the | |
| installEditorBorderListener | back to summary |
|---|---|
| private void installEditorBorderListener(JComponent editor) Remove the border around the inner editor component for LaFs that install an outside border around the spinner, | |
| installKeyboardActions | back to summary |
|---|---|
| protected void installKeyboardActions() Installs the keyboard Actions onto the JSpinner.
| |
| installListeners | back to summary |
|---|---|
| protected void installListeners() Initializes
This method is called by
| |
| installNextButtonListeners | back to summary |
|---|---|
| protected void installNextButtonListeners(Component c) Installs the necessary listeners on the next button,
| |
| installPreviousButtonListeners | back to summary |
|---|---|
| protected void installPreviousButtonListeners(Component c) Installs the necessary listeners on the previous button,
| |
| installUI | back to summary |
|---|---|
| public void installUI(JComponent c) Overrides javax. Calls
| |
| loadActionMap | back to summary |
|---|---|
| pack-priv static void loadActionMap(LazyActionMap map) | |
| maybeAdd | back to summary |
|---|---|
| private void maybeAdd(Component c, String s) | |
| maybeRemoveEditorBorder | back to summary |
|---|---|
| private void maybeRemoveEditorBorder(JComponent editor) Remove the border around the inner editor component for LaFs that install an outside border around the spinner, | |
| removeEditorBorderListener | back to summary |
|---|---|
| private void removeEditorBorderListener(JComponent editor) | |
| replaceEditor | back to summary |
|---|---|
| protected void replaceEditor(JComponent oldEditor, JComponent newEditor) Called by the spinner.remove(oldEditor); spinner.add(newEditor, "Editor");The implementation of replaceEditor should be coordinated
with the createEditor method.
| |
| uninstallDefaults | back to summary |
|---|---|
| protected void uninstallDefaults() Sets the
| |
| uninstallListeners | back to summary |
|---|---|
| protected void uninstallListeners() Removes the
This method is called by
| |
| uninstallUI | back to summary |
|---|---|
| public void uninstallUI(JComponent c) Overrides javax. Calls
| |
| updateEditorAlignment | back to summary |
|---|---|
| private void updateEditorAlignment(JComponent editor) | |
| updateEnabledState | back to summary |
|---|---|
| private void updateEnabledState() Updates the enabled state of the children Components based on the
enabled state of the | |
| updateEnabledState | back to summary |
|---|---|
| private void updateEnabledState(Container c, boolean enabled) Recursively updates the enabled state of the child
| |
Note that one instance of this handler is shared by all slider previous arrow buttons and likewise for all of the next buttons, so it doesn't have any state that persists beyond the limits of a single button pressed/released gesture.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv JButton | |
| pack-priv final Timer | |
| pack-priv final boolean | |
| pack-priv JSpinner |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | actionPerformed(ActionEvent e)
Implements java. Invoked when an action occurs. |
| private JSpinner | |
| public void | focusGained(FocusEvent e)
Implements java. Invoked when a component gains the keyboard focus. |
| public void | focusLost(FocusEvent e)
Implements java. Invoked when a component loses the keyboard focus. |
| private void | focusSpinnerIfNecessary()
Requests focus on a child of the spinner if the spinner doesn't have focus. |
| private int | getCalendarField(JSpinner spinner)
Returns the calendarField under the start of the selection, or -1 if there is no valid calendar field under the selection (or the spinner isn't editing dates. |
| public void | mouseClicked(MouseEvent e)
Implements java. Invoked when the mouse button has been clicked (pressed and released) on a component. |
| public void | mouseEntered(MouseEvent e)
Implements java. Invoked when the mouse enters a component. |
| public void | mouseExited(MouseEvent e)
Implements java. Invoked when the mouse exits a component. |
| public void | mousePressed(MouseEvent e)
Implements java. Invoked when a mouse button has been pressed on a component. |
| public void | mouseReleased(MouseEvent e)
Implements java. Invoked when a mouse button has been released on a component. |
| private void | |
| private boolean | select(JFormattedTextField ftf, AttributedCharacterIterator iterator, DateFormat.
Selects the passed in field, returning true if it is found, false otherwise. |
| arrowButton | back to summary |
|---|---|
| pack-priv JButton arrowButton | |
| autoRepeatTimer | back to summary |
|---|---|
| pack-priv final Timer autoRepeatTimer | |
| isNext | back to summary |
|---|---|
| pack-priv final boolean isNext | |
| spinner | back to summary |
|---|---|
| pack-priv JSpinner spinner | |
| ArrowButtonHandler | back to summary |
|---|---|
| pack-priv ArrowButtonHandler(String name, boolean isNext) | |
| actionPerformed | back to summary |
|---|---|
| public void actionPerformed(ActionEvent e) Implements java. Doc from java. Invoked when an action occurs. | |
| eventToSpinner | back to summary |
|---|---|
| private JSpinner eventToSpinner(AWTEvent e) | |
| focusGained | back to summary |
|---|---|
| public void focusGained(FocusEvent e) Implements java. Doc from java. Invoked when a component gains the keyboard focus. | |
| focusLost | back to summary |
|---|---|
| public void focusLost(FocusEvent e) Implements java. Doc from java. Invoked when a component loses the keyboard focus. | |
| focusSpinnerIfNecessary | back to summary |
|---|---|
| private void focusSpinnerIfNecessary() Requests focus on a child of the spinner if the spinner doesn't have focus. | |
| getCalendarField | back to summary |
|---|---|
| private int getCalendarField(JSpinner spinner) Returns the calendarField under the start of the selection, or -1 if there is no valid calendar field under the selection (or the spinner isn't editing dates. | |
| mouseClicked | back to summary |
|---|---|
| public void mouseClicked(MouseEvent e) Implements java. Doc from java. Invoked when the mouse button has been clicked (pressed and released) on a component. | |
| mouseEntered | back to summary |
|---|---|
| public void mouseEntered(MouseEvent e) Implements java. Doc from java. Invoked when the mouse enters a component. | |
| mouseExited | back to summary |
|---|---|
| public void mouseExited(MouseEvent e) Implements java. Doc from java. Invoked when the mouse exits a component. | |
| mousePressed | back to summary |
|---|---|
| public void mousePressed(MouseEvent e) Implements java. Doc from java. Invoked when a mouse button has been pressed on a component. | |
| mouseReleased | back to summary |
|---|---|
| public void mouseReleased(MouseEvent e) Implements java. Doc from java. Invoked when a mouse button has been released on a component. | |
| select | back to summary |
|---|---|
| private void select(JSpinner spinner) If the spinner's editor is a DateEditor, this selects the field associated with the value that is being incremented. | |
| select | back to summary |
|---|---|
| private boolean select(JFormattedTextField ftf, AttributedCharacterIterator iterator, DateFormat. Selects the passed in field, returning true if it is found, false otherwise. | |
| Modifier and Type | Field and Description |
|---|---|
| private Component | |
| private Component | |
| private Component |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | addLayoutComponent(String name, Component c)
Implements java. If the layout manager uses a per-component string,
adds the component |
| public void | layoutContainer(Container parent)
Implements java. Lays out the specified container. |
| public Dimension | minimumLayoutSize(Container parent)
Implements java. Calculates the minimum size dimensions for the specified container, given the components it contains. |
| public Dimension | preferredLayoutSize(Container parent)
Implements java. Calculates the preferred size dimensions for the specified container, given the components it contains. |
| private Dimension | |
| public void | propertyChange(PropertyChangeEvent e)
Implements java. This method gets called when a bound property is changed. |
| public void | removeLayoutComponent(Component c)
Implements java. Removes the specified component from the layout. |
| private void | |
| public void | stateChanged(ChangeEvent e)
Implements javax. Invoked when the target of the listener has changed its state. |
| private void |
| editor | back to summary |
|---|---|
| private Component editor | |
| nextButton | back to summary |
|---|---|
| private Component nextButton | |
| previousButton | back to summary |
|---|---|
| private Component previousButton | |
| Handler | back to summary |
|---|---|
| private Handler() | |
| addLayoutComponent | back to summary |
|---|---|
| public void addLayoutComponent(String name, Component c) Implements java. Doc from java. If the layout manager uses a per-component string,
adds the component | |
| layoutContainer | back to summary |
|---|---|
| public void layoutContainer(Container parent) Implements java. Doc from java. Lays out the specified container. | |
| minimumLayoutSize | back to summary |
|---|---|
| public Dimension minimumLayoutSize(Container parent) Implements java. Doc from java. Calculates the minimum size dimensions for the specified container, given the components it contains. | |
| preferredLayoutSize | back to summary |
|---|---|
| public Dimension preferredLayoutSize(Container parent) Implements java. Doc from java. Calculates the preferred size dimensions for the specified container, given the components it contains. | |
| preferredSize | back to summary |
|---|---|
| private Dimension preferredSize(Component c) | |
| propertyChange | back to summary |
|---|---|
| public void propertyChange(PropertyChangeEvent e) Implements java. Doc from java. This method gets called when a bound property is changed. | |
| removeLayoutComponent | back to summary |
|---|---|
| public void removeLayoutComponent(Component c) Implements java. Doc from java. Removes the specified component from the layout. | |
| setBounds | back to summary |
|---|---|
| private void setBounds(Component c, int x, int y, int width, int height) | |
| stateChanged | back to summary |
|---|---|
| public void stateChanged(ChangeEvent e) Implements javax. Doc from javax. Invoked when the target of the listener has changed its state. | |
| updateToolTipTextForChildren | back to summary |
|---|---|
| private void updateToolTipTextForChildren(JComponent spinner) | |