Package fr.esrf.tangoatk.widget.util
Class WheelSwitch
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.util.WheelSwitch
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable
- Direct Known Subclasses:
NumberScalarViewer,NumberScalarWheelEditor
A WheelSwitch editor.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionWheelSwitch constructor.WheelSwitch(boolean editable) WheelSwitch constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the specified WheelSwitch Listener.doubledoublegetValue()Returns the current wheelswitch value.booleanstatic voidprotected voidvoidRemove the specified WheelSwitch Listener.voidsetBounds(int x, int y, int w, int h) voidSets the color of arrow buttons.voidsetEnabled(boolean arg0) voidvoidvoidSet the format as C format (only "%x.yf" or "%xd" is supported).voidsetMaxValue(double max) Sets the max value.voidsetMinimumIncrement(double inc) Sets the minimum increment.voidsetMinValue(double min) Sets the min value.voidsetPrecision(int inb, int fnb, int enb) Set the precision of this wheelswitch.voidSets the selected button color.voidSets the text background, null to disable.voidsetValue(double v) Sets the WheelSwitch value.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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods 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, transferFocusDownCycle, validate, validateTreeMethods 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, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
WheelSwitch
public WheelSwitch()WheelSwitch constructor. -
WheelSwitch
public WheelSwitch(boolean editable) WheelSwitch constructor.- Parameters:
editable- Editable flag
-
-
Method Details
-
setMinimumIncrement
public void setMinimumIncrement(double inc) Sets the minimum increment. When try to add a value lower than minimumIncrement, minimumIncrement is added.- Parameters:
inc- Minimum increment
-
getMinimumIncrement
public double getMinimumIncrement() -
setTextBackground
Sets the text background, null to disable.- Parameters:
c- Text background color
-
getPreferredSize
- Overrides:
getPreferredSizein classJComponent
-
getMinimumSize
- Overrides:
getMinimumSizein classJComponent
-
setValue
public void setValue(double v) Sets the WheelSwitch value.- Parameters:
v- New WheelSwitch value.
-
getValue
public double getValue()Returns the current wheelswitch value.- Returns:
- Current value
-
setFont
- Overrides:
setFontin classJComponent
-
isGoodFormat
public boolean isGoodFormat() -
getDigitSize
- Returns:
- the current digit size according the the component Font.
-
setButtonColor
Sets the color of arrow buttons.- Parameters:
c- New button color.
-
getButtonColor
- Returns:
- the current button color.
- See Also:
-
setSelButtonColor
Sets the selected button color.- Parameters:
c- Color for selected button.
-
getSelButtonColor
- Returns:
- the current button selection color.
-
setMaxValue
public void setMaxValue(double max) Sets the max value. Must be called after setFormat() or setPrecision(). Ingnored if scientific format is used.- Parameters:
max- Maximum allowed value
-
setEnabled
public void setEnabled(boolean arg0) - Overrides:
setEnabledin classJComponent
-
setMinValue
public void setMinValue(double min) Sets the min value. Must be called after setFormat() or setPrecision(). Ingnored if scientific format is used.- Parameters:
min- Minimum allowed value
-
setFormat
-
setFormat
Set the format as C format (only "%x.yf" or "%xd" is supported). This will change the button configuration.- Parameters:
aformat- New wheelswitch format.attName- Attribute name
-
setPrecision
public void setPrecision(int inb, int fnb, int enb) Set the precision of this wheelswitch.- Parameters:
inb- number of digit for the integer partfnb- number of digit for the decimal partenb- number of digit for the exponent part
-
paintComponent
- Overrides:
paintComponentin classJComponent
-
addWheelSwitchListener
Add the specified WheelSwitch Listener.- Parameters:
l- WheelSwitch Listener
-
removeWheelSwitchListener
Remove the specified WheelSwitch Listener.- Parameters:
l- WheelSwitch Listener to be removed
-
setBounds
public void setBounds(int x, int y, int w, int h) -
main
-