< prev index next >
src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java
Print this page
@@ -49,12 +49,12 @@
*/
public class BasicSpinnerUI extends SpinnerUI
{
/**
* The spinner that we're a UI delegate for. Initialized by
- * the <code>installUI</code> method, and reset to null
- * by <code>uninstallUI</code>.
+ * the {@code installUI} method, and reset to null
+ * by {@code uninstallUI}.
*
* @see #installUI
* @see #uninstallUI
*/
protected JSpinner spinner;
@@ -100,13 +100,13 @@
}
}
/**
- * Calls <code>installDefaults</code>, <code>installListeners</code>,
- * and then adds the components returned by <code>createNextButton</code>,
- * <code>createPreviousButton</code>, and <code>createEditor</code>.
+ * Calls {@code installDefaults}, {@code installListeners},
+ * and then adds the components returned by {@code createNextButton},
+ * {@code createPreviousButton}, and {@code createEditor}.
*
* @param c the JSpinner
* @see #installDefaults
* @see #installListeners
* @see #createNextButton
@@ -124,11 +124,11 @@
installKeyboardActions();
}
/**
- * Calls <code>uninstallDefaults</code>, <code>uninstallListeners</code>,
+ * Calls {@code uninstallDefaults}, {@code uninstallListeners},
* and then removes all of the spinners children.
*
* @param c the JSpinner (not used)
*/
public void uninstallUI(JComponent c) {
@@ -138,15 +138,15 @@
c.removeAll();
}
/**
- * Initializes <code>PropertyChangeListener</code> with
+ * Initializes {@code PropertyChangeListener} with
* a shared object that delegates interesting PropertyChangeEvents
* to protected methods.
* <p>
- * This method is called by <code>installUI</code>.
+ * This method is called by {@code installUI}.
*
* @see #replaceEditor
* @see #uninstallListeners
*/
protected void installListeners() {
@@ -166,14 +166,14 @@
}
}
/**
- * Removes the <code>PropertyChangeListener</code> added
+ * Removes the {@code PropertyChangeListener} added
* by installListeners.
* <p>
- * This method is called by <code>uninstallUI</code>.
+ * This method is called by {@code uninstallUI}.
*
* @see #installListeners
*/
protected void uninstallListeners() {
spinner.removePropertyChangeListener(propertyChangeListener);
@@ -191,15 +191,15 @@
handler = null;
}
/**
- * Initialize the <code>JSpinner</code> <code>border</code>,
- * <code>foreground</code>, and <code>background</code>, properties
+ * Initialize the {@code JSpinner border},
+ * {@code foreground}, and {@code background}, properties
* based on the corresponding "Spinner.*" properties from defaults table.
- * The <code>JSpinners</code> layout is set to the value returned by
- * <code>createLayout</code>. This method is called by <code>installUI</code>.
+ * The {@code JSpinners} layout is set to the value returned by
+ * {@code createLayout}. This method is called by {@code installUI}.
*
* @see #uninstallDefaults
* @see #installUI
* @see #createLayout
* @see LookAndFeel#installBorder
@@ -212,12 +212,12 @@
LookAndFeel.installProperty(spinner, "opaque", Boolean.TRUE);
}
/**
- * Sets the <code>JSpinner's</code> layout manager to null. This
- * method is called by <code>uninstallUI</code>.
+ * Sets the {@code JSpinner's} layout manager to null. This
+ * method is called by {@code uninstallUI}.
*
* @see #installDefaults
* @see #uninstallUI
*/
protected void uninstallDefaults() {
@@ -232,28 +232,28 @@
return handler;
}
/**
- * Installs the necessary listeners on the next button, <code>c</code>,
- * to update the <code>JSpinner</code> in response to a user gesture.
+ * Installs the necessary listeners on the next button, {@code c},
+ * to update the {@code JSpinner} in response to a user gesture.
*
* @param c Component to install the listeners on
- * @throws NullPointerException if <code>c</code> is null.
+ * @throws NullPointerException if {@code c} is null.
* @see #createNextButton
* @since 1.5
*/
protected void installNextButtonListeners(Component c) {
installButtonListeners(c, nextButtonHandler);
}
/**
- * Installs the necessary listeners on the previous button, <code>c</code>,
- * to update the <code>JSpinner</code> in response to a user gesture.
+ * Installs the necessary listeners on the previous button, {@code c},
+ * to update the {@code JSpinner} in response to a user gesture.
*
* @param c Component to install the listeners on.
- * @throws NullPointerException if <code>c</code> is null.
+ * @throws NullPointerException if {@code c} is null.
* @see #createPreviousButton
* @since 1.5
*/
protected void installPreviousButtonListeners(Component c) {
installButtonListeners(c, previousButtonHandler);
@@ -266,12 +266,12 @@
}
c.addMouseListener(handler);
}
/**
- * Creates a <code>LayoutManager</code> that manages the <code>editor</code>,
- * <code>nextButton</code>, and <code>previousButton</code>
+ * Creates a {@code LayoutManager} that manages the {@code editor},
+ * {@code nextButton}, and {@code previousButton}
* children of the JSpinner. These three children must be
* added with a constraint that identifies their role:
* "Editor", "Next", and "Previous". The default layout manager
* can handle the absence of any of these children.
*
@@ -284,16 +284,16 @@
return getHandler();
}
/**
- * Creates a <code>PropertyChangeListener</code> that can be
+ * Creates a {@code PropertyChangeListener} that can be
* added to the JSpinner itself. Typically, this listener
* will call replaceEditor when the "editor" property changes,
- * since it's the <code>SpinnerUI's</code> responsibility to
+ * since it's the {@code SpinnerUI's} responsibility to
* add the editor to the JSpinner (and remove the old one).
- * This method is called by <code>installListeners</code>.
+ * This method is called by {@code installListeners}.
*
* @return A PropertyChangeListener for the JSpinner itself
* @see #installListeners
*/
protected PropertyChangeListener createPropertyChangeListener() {
@@ -301,12 +301,12 @@
}
/**
* Creates a decrement button, i.e. component that replaces the spinner
- * value with the object returned by <code>spinner.getPreviousValue</code>.
- * By default the <code>previousButton</code> is a {@code JButton}. If the
+ * value with the object returned by {@code spinner.getPreviousValue}.
+ * By default the {@code previousButton} is a {@code JButton}. If the
* decrement button is not needed this method should return {@code null}.
*
* @return a component that will replace the spinner's value with the
* previous value in the sequence, or {@code null}
* @see #installUI
@@ -321,12 +321,12 @@
}
/**
* Creates an increment button, i.e. component that replaces the spinner
- * value with the object returned by <code>spinner.getNextValue</code>.
- * By default the <code>nextButton</code> is a {@code JButton}. If the
+ * value with the object returned by {@code spinner.getNextValue}.
+ * By default the {@code nextButton} is a {@code JButton}. If the
* increment button is not needed this method should return {@code null}.
*
* @return a component that will replace the spinner's value with the
* next value in the sequence, or {@code null}
* @see #installUI
@@ -355,25 +355,25 @@
}
/**
* This method is called by installUI to get the editor component
- * of the <code>JSpinner</code>. By default it just returns
- * <code>JSpinner.getEditor()</code>. Subclasses can override
- * <code>createEditor</code> to return a component that contains
+ * of the {@code JSpinner}. By default it just returns
+ * {@code JSpinner.getEditor()}. Subclasses can override
+ * {@code createEditor} to return a component that contains
* the spinner's editor or null, if they're going to handle adding
- * the editor to the <code>JSpinner</code> in an
- * <code>installUI</code> override.
+ * the editor to the {@code JSpinner} in an
+ * {@code installUI} override.
* <p>
* 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.
* <p>
- * The <code>replaceEditor</code> method is called when the spinners
- * editor is changed with <code>JSpinner.setEditor</code>. If you've
+ * The {@code replaceEditor} method is called when the spinners
+ * editor is changed with {@code JSpinner.setEditor}. If you've
* overriden this method, then you'll probably want to override
- * <code>replaceEditor</code> as well.
+ * {@code replaceEditor} as well.
*
* @return the JSpinners editor JComponent, spinner.getEditor() by default
* @see #installUI
* @see #replaceEditor
* @see JSpinner#getEditor
@@ -387,20 +387,20 @@
return editor;
}
/**
- * Called by the <code>PropertyChangeListener</code> when the
- * <code>JSpinner</code> editor property changes. It's the responsibility
+ * Called by the {@code PropertyChangeListener} when the
+ * {@code JSpinner} editor property changes. It's the responsibility
* of this method to remove the old editor and add the new one. By
* default this operation is just:
* <pre>
* spinner.remove(oldEditor);
* spinner.add(newEditor, "Editor");
* </pre>
- * The implementation of <code>replaceEditor</code> should be coordinated
- * with the <code>createEditor</code> method.
+ * The implementation of {@code replaceEditor} should be coordinated
+ * with the {@code createEditor} method.
*
* @param oldEditor an old instance of editor
* @param newEditor a new instance of editor
* @see #createEditor
* @see #createPropertyChangeListener
@@ -475,20 +475,20 @@
}
/**
* Updates the enabled state of the children Components based on the
- * enabled state of the <code>JSpinner</code>.
+ * enabled state of the {@code JSpinner}.
*/
private void updateEnabledState() {
updateEnabledState(spinner, spinner.isEnabled());
}
/**
* Recursively updates the enabled state of the child
- * <code>Component</code>s of <code>c</code>.
+ * {@code Component}s of {@code c}.
*/
private void updateEnabledState(Container c, boolean enabled) {
for (int counter = c.getComponentCount() - 1; counter >= 0;counter--) {
Component child = c.getComponent(counter);
@@ -533,11 +533,11 @@
LazyActionMap.installLazyActionMap(spinner, BasicSpinnerUI.class,
"Spinner.actionMap");
}
/**
- * Returns the InputMap to install for <code>condition</code>.
+ * Returns the InputMap to install for {@code condition}.
*/
private InputMap getInputMap(int condition) {
if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) {
return (InputMap)DefaultLookup.get(spinner, this,
"Spinner.ancestorInputMap");
< prev index next >