|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JSpinner
org.formaria.swing.Spinner
public class Spinner
An Up-Down control or spin edit component
Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from formaria.
$Revision: 1.14 $
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JSpinner |
|---|
javax.swing.JSpinner.AccessibleJSpinner, javax.swing.JSpinner.DateEditor, javax.swing.JSpinner.DefaultEditor, javax.swing.JSpinner.ListEditor, javax.swing.JSpinner.NumberEditor |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected java.lang.String |
errorMessage
|
protected int |
errorStatus
|
static int |
SPINNER_TYPE_DOUBLE
|
static int |
SPINNER_TYPE_INT
|
protected javax.swing.SpinnerNumberModel |
spinnerModel
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
Spinner()
Create a new spinner |
|
| Method Summary | |
|---|---|
void |
addHandler(java.lang.Object page,
java.lang.String type,
java.lang.String methodName)
Add a new event handler |
void |
addNotify()
Repaint the component once it has been created |
int |
getIntValue()
Get the object's value |
double |
getMax()
Gets the value corresponding to the maximum value of the meter |
double |
getMin()
Gets the value corresponding to the minimum value of the meter |
double |
getStep()
Gets the step size for the spinner |
java.lang.String |
getText()
Get the text/label of the component |
java.lang.Object |
getValue()
Get the object's value |
void |
init()
Performs any post creation initialisation of the control. |
void |
paint(java.awt.Graphics g)
|
void |
setBackground(java.awt.Color c)
Set the background color of the editor component |
void |
setBuddy(Edit je)
Set an edit component to update |
void |
setDataType(java.lang.String type)
|
void |
setErrorMessage(java.lang.String errorMsg)
Set the error message |
void |
setErrorStatus(int status)
Set the error status |
void |
setForeground(java.awt.Color c)
Set the foreground color of the editor component |
void |
setMax(double _value)
Sets the value corresponding to the maximum value of the meter |
void |
setMin(double _value)
Sets the value corresponding to the minimum value of the meter |
void |
setRange(int min,
int max)
Set the spinner range |
void |
setStep(double _value)
Sets the step size for the spinner |
void |
setText(java.lang.String s)
Get the text/label of the component |
void |
setValue(java.lang.Object value)
Set the value associated with this component |
void |
stateChanged(javax.swing.event.ChangeEvent e)
The state changed |
| Methods inherited from class javax.swing.JSpinner |
|---|
addChangeListener, commitEdit, createEditor, fireStateChanged, getAccessibleContext, getChangeListeners, getEditor, getModel, getNextValue, getPreviousValue, getUI, getUIClassID, removeChangeListener, setEditor, setModel, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected javax.swing.SpinnerNumberModel spinnerModel
public static final int SPINNER_TYPE_INT
public static final int SPINNER_TYPE_DOUBLE
protected int errorStatus
protected java.lang.String errorMessage
| Constructor Detail |
|---|
public Spinner()
| Method Detail |
|---|
public void setForeground(java.awt.Color c)
setForeground in class javax.swing.JComponentc - the new colorpublic void setBackground(java.awt.Color c)
setBackground in class javax.swing.JComponentc - the new colorpublic void setBuddy(Edit je)
je - the component to update
public void setRange(int min,
int max)
min - the max valuemax - the minimum valuepublic void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged in interface javax.swing.event.ChangeListenere - the state event
public void init()
throws java.io.IOException
java.io.IOException - This component diesnt do any IO, but the exception is a boilerplatepublic void setMax(double _value)
_value - the new max valuepublic void setMin(double _value)
_value - the new min valuepublic void setStep(double _value)
_value - the new step sizepublic void setDataType(java.lang.String type)
public double getMax()
public double getMin()
public double getStep()
public void addNotify()
addNotify in class javax.swing.JComponent
public void addHandler(java.lang.Object page,
java.lang.String type,
java.lang.String methodName)
throws java.lang.NoSuchMethodException
addHandler in interface ListenerHelperpage - the owner pagetype - the event handler typemethodName - the method name
java.lang.NoSuchMethodException - through if the method cannot be foundpublic java.lang.Object getValue()
getValue in interface ValueHoldergetValue in class javax.swing.JSpinnerpublic int getIntValue()
public void setValue(java.lang.Object value)
setValue in interface ValueHoldersetValue in class javax.swing.JSpinnernewValue - the new object valuepublic void setText(java.lang.String s)
setText in interface TextHolders - the new textpublic java.lang.String getText()
getText in interface TextHolderpublic void setErrorStatus(int status)
setErrorStatus in interface ErrorDisplaystatus - public void setErrorMessage(java.lang.String errorMsg)
setErrorMessage in interface ErrorDisplayerrorMsg - the message textpublic void paint(java.awt.Graphics g)
paint in class javax.swing.JComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||