|
|||||||||
| 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.JPanel
org.jscience.swing.spinner.SpinnerTimerControl
public class SpinnerTimerControl
This JPanel contains a JSpinner and a
TimerControlPanel
handling a timer iterating through the SpinnerModel's
sequence.
| action | ![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|
| left mouse click | runs the timer backward through the spinner's sequence | resets to value 0 if it is in the domain and the SpinnerModel
is a SpinnerNumberModel, otherwise does nothing |
runs the timer forward through the spinner's sequence | stops the timer |
| right mouse click | jump to the minimum value of the spinner's sequence (only if the
SpinnerModel is a SpinnerNumberModel and a lower
limit is set, otherwise the timer if running will stop at the current value) |
does nothing | jump to the maximum value of the spinner's sequence (only if the
SpinnerModel is a SpinnerNumberModel and an upper
limit is set, otherwise the timer if running will stop at the current value) |
does nothing |
is only seen, if the timer is not running
is only seen, if the timer is running
ArrowIcon,
SquareIcon,
RectanglesIcon,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| 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 | |
|---|---|
static int |
HORIZONTAL
Final variable to adjust the two UI components JSpinner and
TimerControlPanel horizontally. |
static int |
VERTICAL
Final variable to adjust the two UI components JSpinner and
TimerControlPanel vertically. |
static java.lang.String |
ZERO_STRING
|
| 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 | |
|---|---|
SpinnerTimerControl()
Creates a new SpinnerTimerControl with a
SpinnerNumberModel as the current
SpinnerModel. |
|
SpinnerTimerControl(javax.swing.SpinnerModel spinnerModel)
Creates a new SpinnerTimerControl with the
specified SpinnerModel as the current
SpinnerModel. |
|
SpinnerTimerControl(javax.swing.SpinnerModel spinnerModel,
int adjustment)
Creates a new SpinnerTimerControl with the specified
SpinnerModel as the current SpinnerModel. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds a listener to the list that is notified each time a change to the spinner's model occurs. |
protected void |
fireStateChanged()
Sends a ChangeEvent, whose source is this SpinnerTimerControl, to each listener which was added to this SpinnerTimerControl. |
int |
getLayoutAdjustment()
Returns the current layout adjustment. |
javax.swing.SpinnerModel |
getSpinnerModel()
Returns the current SpinnerModel. |
SharableTimer |
getTimer()
Returns the SharableTimer this' TimerControlPanel is using. |
int |
getTimerDelay()
Returns the current timer delay in msec. |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes a ChangeListener from this SpinnerTimerControl. |
void |
setLayoutAdjustment(int newAdjustment)
Sets a new layout adjustment and revalidates this JPanel's component tree. |
void |
setSpinnerModel(javax.swing.SpinnerModel newModel)
Sets this' SpinnerModel to the specified one. |
void |
setTimer(SharableTimer timer)
Sets a new SharableTimer this' TimerControlPanel should use. |
void |
setTimerDelay(int newDelay)
Sets the timer delay (in msec) to newDelay. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, 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, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, 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 |
|---|
public static final int HORIZONTAL
JSpinner and
TimerControlPanel horizontally.
SpinnerTimerControl(SpinnerModel,int),
Constant Field Valuespublic static final int VERTICAL
JSpinner and
TimerControlPanel vertically.
SpinnerTimerControl(SpinnerModel,int),
Constant Field Valuespublic static final java.lang.String ZERO_STRING
| Constructor Detail |
|---|
public SpinnerTimerControl()
SpinnerTimerControl with a
SpinnerNumberModel as the current
SpinnerModel. The adjustment of the JSpinner
and TimerControlPanel
is HORIZONTAL.
public SpinnerTimerControl(javax.swing.SpinnerModel spinnerModel)
SpinnerTimerControl with the
specified SpinnerModel as the current
SpinnerModel. The adjustment of the
JSpinner and TimerControlPanel
is HORIZONTAL.
public SpinnerTimerControl(javax.swing.SpinnerModel spinnerModel,
int adjustment)
SpinnerTimerControl with the specified
SpinnerModel as the current SpinnerModel.
The int value specifies the adjustment of the UI components
JSpinner and TimerControlPanel to each other. Use one of the final fields
HORIZONTAL and VERTICAL.
adjustment - HORIZONTAL or VERTICAL.| Method Detail |
|---|
public void addChangeListener(javax.swing.event.ChangeListener l)
l - the ChangeListener to addprotected void fireStateChanged()
#addChangeListener(ChangeListenerl)public int getLayoutAdjustment()
public javax.swing.SpinnerModel getSpinnerModel()
SpinnerModel.
SpinnerModel.setSpinnerModel(SpinnerModel)public SharableTimer getTimer()
TimerControlPanel.getTimer()public int getTimerDelay()
setTimerDelay(int),
Timer.getDelay()public void removeChangeListener(javax.swing.event.ChangeListener l)
l - the listener to remove.public void setLayoutAdjustment(int newAdjustment)
JPanel's component tree.
Possible adjustments are: HORIZONTAL, VERTICAL.
newAdjustment - The new layout adjustment.public void setSpinnerModel(javax.swing.SpinnerModel newModel)
SpinnerModel to the specified one.
newModel - The new SpinnerModel.getSpinnerModel()public void setTimer(SharableTimer timer)
timer - the new Timer.TimerControlPanel.setTimer(SharableTimer)public void setTimerDelay(int newDelay)
newDelay.
newDelay - The new timer delay in msec.getTimerDelay()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||