|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--org.ssonet.awt.Spinner
A typein field for an integer.
Field Summary | |
protected int |
ascent
|
protected java.awt.Color |
backgroundColor
|
protected boolean |
borderPainted
|
protected java.awt.Dimension |
d
|
protected int |
digitsTyped
|
protected java.awt.FontMetrics |
fm
|
protected boolean |
haveFocus
|
protected int |
leadingPad
|
protected int |
maxValue
|
protected int |
minValue
|
protected int |
nDigits
|
protected java.lang.String |
txt
|
protected int |
value
|
boolean |
wrapped
|
protected boolean |
wraps
|
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.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.Adjustable |
HORIZONTAL, NO_ORIENTATION, VERTICAL |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Spinner(int startValue)
|
|
Spinner(int startValue,
java.lang.String t)
|
Method Summary | |
void |
addAdjustmentListener(java.awt.event.AdjustmentListener l)
Add a listener to recieve adjustment events when the value of the Spinner changes. |
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Spinners can both send and recieve AdjustmentEvents -- they can be cascaded together for situations where there are multiple ways to enter the same value (popup menu or typin number) |
protected void |
fireAdjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Notify all listeners that have registered interest for notification on this event type. |
void |
focusGained(java.awt.event.FocusEvent e)
|
void |
focusLost(java.awt.event.FocusEvent e)
|
java.awt.Color |
getBackgroundColor()
|
int |
getBlockIncrement()
Does nothing -- part of the Adjustable interface. |
int |
getDigits()
|
int |
getLeadingPad()
|
int |
getMaximum()
Gets the maximum value of the Spinner. |
int |
getMinimum()
Gets the minimum value of the Spinner. |
int |
getOrientation()
Does nothing -- part of the Adjustable interface. |
java.lang.String |
getText()
|
org.ssonet.awt.SpinnerUI |
getUI()
|
java.lang.String |
getUIClassID()
|
int |
getUnitIncrement()
Does nothing -- part of the Adjustable interface. |
int |
getValue()
Gets the current value of the Spinner object. |
int |
getVisibleAmount()
Does nothing -- part of the Adjustable interface. |
boolean |
getWrap()
|
boolean |
hasFocus()
|
boolean |
isBorderPainted()
|
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
protected void |
paintBorder(java.awt.Graphics g)
Paint the spinner's border if BorderPainted property is true. |
void |
removeAdjustmentListener(java.awt.event.AdjustmentListener l)
Removes an adjustment listener. |
void |
setBackgroundColor(java.awt.Color newColor)
|
void |
setBlockIncrement(int b)
Does nothing -- part of the Adjustable interface. |
void |
setBorderPainted(boolean b)
|
void |
setDigits(int n)
|
void |
setFont(java.awt.Font f)
|
void |
setLeadingPad(int newPad)
|
void |
setMaximum(int max)
Sets the maximum value of the Spinner. |
void |
setMinimum(int min)
Sets the minimum value of the Spinner. |
void |
setText(java.lang.String s)
A Spinner can have a string associated with it, which is placed at the right of the number |
void |
setUI(org.ssonet.awt.SpinnerUI ui)
|
void |
setUnitIncrement(int u)
Does nothing -- part of the Adjustable interface. |
void |
setValue(int v)
Sets the current value of the Spinner. |
void |
setVisibleAmount(int v)
Does nothing -- part of the Adjustable interface. |
void |
setWrap(boolean w)
A Spinner for which wrapping is true wraps around to the minimum value when the maximum value is exceeded, and vice versa. |
void |
updateUI()
|
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 java.lang.String txt
protected java.awt.Dimension d
protected int ascent
protected int value
protected boolean haveFocus
protected int minValue
protected int maxValue
protected java.awt.FontMetrics fm
protected int nDigits
protected int digitsTyped
protected boolean wraps
protected boolean borderPainted
protected java.awt.Color backgroundColor
protected int leadingPad
public boolean wrapped
Constructor Detail |
public Spinner(int startValue, java.lang.String t)
public Spinner(int startValue)
Method Detail |
public int getValue()
getValue
in interface java.awt.Adjustable
public void setValue(int v)
setValue
in interface java.awt.Adjustable
v
- the current valuepublic void setWrap(boolean w)
w
- true if wrapping is to be enabled, false if the
value is to be clamped.public boolean getWrap()
public void setText(java.lang.String s)
s
- the new text valuepublic java.lang.String getText()
public void setFont(java.awt.Font f)
setFont
in class javax.swing.JComponent
public void setDigits(int n)
public int getDigits()
public void setLeadingPad(int newPad)
public int getLeadingPad()
public void setBackgroundColor(java.awt.Color newColor)
public java.awt.Color getBackgroundColor()
public boolean hasFocus()
hasFocus
in class java.awt.Component
public boolean isBorderPainted()
public void setBorderPainted(boolean b)
protected void paintBorder(java.awt.Graphics g)
paintBorder
in class javax.swing.JComponent
JComponent.paint(java.awt.Graphics)
,
JComponent.setBorder(javax.swing.border.Border)
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged
in interface java.awt.event.AdjustmentListener
public void setMinimum(int min)
setMinimum
in interface java.awt.Adjustable
min
- the minimum valuepublic int getMinimum()
getMinimum
in interface java.awt.Adjustable
public void setMaximum(int max)
setMaximum
in interface java.awt.Adjustable
max
- the maximum valuepublic int getMaximum()
getMaximum
in interface java.awt.Adjustable
public void addAdjustmentListener(java.awt.event.AdjustmentListener l)
addAdjustmentListener
in interface java.awt.Adjustable
l
- the listener to recieve eventsAdjustmentEvent
public void removeAdjustmentListener(java.awt.event.AdjustmentListener l)
removeAdjustmentListener
in interface java.awt.Adjustable
l
- the listener being removedAdjustmentEvent
protected void fireAdjustmentValueChanged(java.awt.event.AdjustmentEvent e)
public void setUnitIncrement(int u)
setUnitIncrement
in interface java.awt.Adjustable
u
- the unit incrementpublic int getUnitIncrement()
getUnitIncrement
in interface java.awt.Adjustable
public void setBlockIncrement(int b)
setBlockIncrement
in interface java.awt.Adjustable
b
- the block incrementpublic int getBlockIncrement()
getBlockIncrement
in interface java.awt.Adjustable
public void setVisibleAmount(int v)
setVisibleAmount
in interface java.awt.Adjustable
v
- the length of the indicatorpublic int getVisibleAmount()
getVisibleAmount
in interface java.awt.Adjustable
public int getOrientation()
getOrientation
in interface java.awt.Adjustable
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public org.ssonet.awt.SpinnerUI getUI()
public void setUI(org.ssonet.awt.SpinnerUI ui)
public void updateUI()
updateUI
in class javax.swing.JComponent
public java.lang.String getUIClassID()
getUIClassID
in class javax.swing.JComponent
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |