public class Wheelswitch
extends javax.swing.JPanel
javax.swing.JPanel
that contains a row of digits
and optionally a two way up-down button. It can be used for displaying and
modifying a single formatted double
value with an optional
unit string (also in digits) displyed next to the value. Value manipulation
and display formatting is handled by the WheelswitchFormatter
.UpDownButton
,
Digit
,
WheelswitchFormatter
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected class |
Wheelswitch.FocusHandler |
protected class |
Wheelswitch.KeyHandler |
protected class |
Wheelswitch.MouseHandler |
protected class |
Wheelswitch.MouseWheelHandler |
protected class |
Wheelswitch.TiltHandler |
protected class |
Wheelswitch.UpDownActionHandler |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected static int |
DECREASE_SELECTION |
static java.lang.String |
EDITABLE
DOCUMENT ME!
|
protected Wheelswitch.FocusHandler |
focusHandler |
protected static int |
INCREASE_SELECTION |
protected Wheelswitch.KeyHandler |
keyHandler |
protected Wheelswitch.MouseHandler |
mouseHandler |
protected Wheelswitch.TiltHandler |
tiltHandler |
static java.lang.String |
VALUE
DOCUMENT ME!
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
Wheelswitch()
Constructor for Wheelswitch which sets no format or unit and the value
is set to zero.
|
Wheelswitch(double newValue)
Constructor for
Wheelswitch setting only the value. |
Wheelswitch(java.lang.String newFormat,
double newValue,
java.lang.String newUnit)
Constructor for
Wheelswitch creates a new Wheelswitch with
the specified value, format and unit. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFormat()
Gets the format of the display.
|
double |
getGraphMax()
Gets the maximum alowed value.
|
double |
getGraphMin()
Gets the minimum alowed value.
|
java.awt.Dimension |
getMinimumSize()
This method has been overriden to implement correct layout and resizing
features.
|
java.awt.Dimension |
getPreferredSize()
This method has been overriden to implement correct layout and resizing
features.
|
protected int |
getSelectedDigit() |
java.lang.String |
getUnit()
Gets the unit displayed next to the value.
|
double |
getValue()
Gets the value displayed by the
Wheelswitch and stored by
the formatter . |
protected void |
initDigits() |
boolean |
isEditable()
Returns whether the wheelswitch can be edited by the user.
|
boolean |
isEnhanced()
Gets the enhancement mode of the
Wheelswitch . |
boolean |
isTiltingEnabled()
Returns whether the component should indicate value out of bounds
condition by visually tilting its border.
|
protected void |
setDigitValue(int i,
int newValue) |
void |
setEditable(boolean newEditable)
Sets the editability of the wheelswitch.
|
void |
setEnabled(boolean arg0)
Overriden to implement digit and upDownButton enabling/disabling.
|
void |
setEnhanced(boolean enhanced)
Sets the enhanced property of the wheelswitch.
|
void |
setFormat(java.lang.String newFormat)
Sets the format of the value display.
|
void |
setGraphMax(double newValue)
Sets the maximum allowed value.
|
void |
setGraphMin(double newValue)
Sets the minimum allowed value.
|
void |
setMaximumDigits(int bound)
Sets the maximum number of value digits allowed to be displayed in the
wheelswitch.
|
void |
setMaxMin(double max,
double min)
Sets the maximum and minimum allowed values.
|
protected void |
setSelectedDigit(int i) |
void |
setTiltingEnabled(boolean b)
Sets the tilitng enabled property.
|
void |
setUnit(java.lang.String newUnit)
Sets the unit to be displayed next to the value.
|
void |
setValue(double newValue)
Sets the value and displays it in the wheelswitch.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
protected static int INCREASE_SELECTION
protected static int DECREASE_SELECTION
public static final java.lang.String VALUE
public static final java.lang.String EDITABLE
protected Wheelswitch.FocusHandler focusHandler
protected Wheelswitch.KeyHandler keyHandler
protected Wheelswitch.MouseHandler mouseHandler
protected Wheelswitch.TiltHandler tiltHandler
public Wheelswitch(java.lang.String newFormat, double newValue, java.lang.String newUnit)
Wheelswitch
creates a new Wheelswitch with
the specified value, format and unit. No minimum or maximum values are
set.newFormat
- newValue
- newUnit
- public Wheelswitch(double newValue)
Wheelswitch
setting only the value. No
format or unit are set.newValue
- Wheelswitch(String, double, String)
public Wheelswitch()
Wheelswitch(String, double, String)
public void setEditable(boolean newEditable)
newEditable
- public boolean isEditable()
public void setEnhanced(boolean enhanced)
Digit.setEnhanced(boolean)
public boolean isEnhanced()
Wheelswitch
.public void setFormat(java.lang.String newFormat)
newFormat
- java.lang.NullPointerException
- DOCUMENT ME!WheelswitchFormatter.setFormat(String)
public java.lang.String getFormat()
WheelswitchFormatter.getFormat()
public void setGraphMax(double newValue)
newValue
- WheelswitchFormatter.setMaximum(double)
public double getGraphMax()
WheelswitchFormatter.getMaximum()
public void setGraphMin(double newValue)
newValue
- WheelswitchFormatter.setMinimum(double)
public double getGraphMin()
WheelswitchFormatter.getMaximum()
public void setMaxMin(double max, double min)
max
- min
- public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
Component.getMinimumSize()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
Component.getPreferredSize()
public void setTiltingEnabled(boolean b)
b
- whether the component should tilt when value is out of bounds.public boolean isTiltingEnabled()
public void setUnit(java.lang.String newUnit)
newUnit
- WheelswitchFormatter.setUnit(String)
public java.lang.String getUnit()
WheelswitchFormatter.getUnit()
public void setValue(double newValue)
newValue
- WheelswitchFormatter.setValue(double)
public double getValue()
Wheelswitch
and stored by
the formatter
.WheelswitchFormatter.getValue()
public void setEnabled(boolean arg0)
setEnabled
in class javax.swing.JComponent
Component.setEnabled(boolean)
public void setMaximumDigits(int bound)
bound
- is ignored if less or equal zero.protected void setDigitValue(int i, int newValue)
protected void setSelectedDigit(int i)
protected int getSelectedDigit()
protected void initDigits()