de.matthiasmann.twl
Class ValueAdjusterFloat

java.lang.Object
  extended by de.matthiasmann.twl.Widget
      extended by de.matthiasmann.twl.ValueAdjuster
          extended by de.matthiasmann.twl.ValueAdjusterFloat

public class ValueAdjusterFloat
extends ValueAdjuster

A value adjuster for floats.


Nested Class Summary
 
Nested classes/interfaces inherited from class de.matthiasmann.twl.Widget
Widget.OffscreenMouseAdjustments, Widget.RenderOffscreen
 
Field Summary
 
Fields inherited from class de.matthiasmann.twl.ValueAdjuster
STATE_EDIT_ACTIVE
 
Fields inherited from class de.matthiasmann.twl.Widget
STATE_DISABLED, STATE_HAS_FOCUSED_CHILD, STATE_HAS_OPEN_POPUPS, STATE_KEYBOARD_FOCUS
 
Constructor Summary
ValueAdjusterFloat()
           
ValueAdjusterFloat(FloatModel model)
           
 
Method Summary
protected  void addModelCallback()
           
protected  void afterAddToGUI(GUI gui)
          Called after this widget has been added to a GUI tree.
protected  void beforeRemoveFromGUI(GUI gui)
          Called when this widget is removed from the GUI tree.
protected  void doDecrement()
           
protected  void doIncrement()
           
protected  java.lang.String formatText()
           
 java.lang.String getFormat()
           
 java.util.Locale getLocale()
           
 float getMaxValue()
           
 float getMinValue()
           
 FloatModel getModel()
           
 float getStepSize()
           
 float getValue()
           
protected  void onDragCancelled()
           
protected  void onDragStart()
           
protected  void onDragUpdate(int dragDelta)
           
protected  void onEditCanceled()
           
protected  boolean onEditEnd(java.lang.String text)
           
protected  java.lang.String onEditStart()
           
protected  float parseText(java.lang.String value)
           
protected  void removeModelCallback()
           
 void setFormat(java.lang.String format)
           
 void setLocale(java.util.Locale locale)
           
 void setMinMaxValue(float minValue, float maxValue)
           
 void setModel(FloatModel model)
           
 void setStepSize(float stepSize)
          Sets the step size for the value adjuster.
 void setValue(float value)
           
protected  boolean shouldStartEdit(char ch)
           
protected  void syncWithModel()
           
protected  java.lang.String validateEdit(java.lang.String text)
           
 
Methods inherited from class de.matthiasmann.twl.ValueAdjuster
applyTheme, applyThemeValueAdjuster, cancelEdit, cancelOrAcceptEdit, getDisplayPrefix, getMinHeight, getMinWidth, getPreferredInnerHeight, getPreferredInnerWidth, handleEvent, isAcceptValueOnFocusLoss, isUseMouseWheel, keyboardFocusGained, keyboardFocusGained, keyboardFocusLost, layout, onDragEnd, setAcceptValueOnFocusLoss, setDisplayPrefix, setDisplayText, setTooltipContent, setUseMouseWheel, setVisible, startEdit, widgetDisabled
 
Methods inherited from class de.matthiasmann.twl.Widget
add, addActionMapping, addPropertyChangeListener, addPropertyChangeListener, adjustSize, allChildrenRemoved, applyThemeBackground, applyThemeBorder, applyThemeInputMap, applyThemeMaxSize, applyThemeMinSize, applyThemeMouseCursor, applyThemeOffscreenExtra, applyThemeOverlay, applyThemeTooltip, borderChanged, canAcceptKeyboardFocus, childAdded, childInvalidateLayout, childRemoved, childVisibilityChanged, computeSize, destroy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, focusFirstChild, focusLastChild, focusNextChild, focusPrevChild, getActionMap, getAnimationState, getBackground, getBorderBottom, getBorderHorizontal, getBorderLeft, getBorderRight, getBorderTop, getBorderVertical, getBottom, getChild, getChildAt, getChildIndex, getGUI, getHeight, getInnerBottom, getInnerHeight, getInnerRight, getInnerWidth, getInnerX, getInnerY, getInputMap, getKeyboardFocusOrder, getMaxHeight, getMaxWidth, getMouseCursor, getMouseCursor, getNumChildren, getOffscreenExtraBottom, getOffscreenExtraLeft, getOffscreenExtraRight, getOffscreenExtraTop, getOrCreateActionMap, getOverlay, getParent, getPreferredHeight, getPreferredWidth, getRenderOffscreen, getRight, getRootWidget, getTheme, getThemePath, getThemeTooltipContent, getTintAnimator, getTooltipContent, getTooltipContentAt, getWidgetAt, getWidth, getX, getY, giveupKeyboardFocus, handleKeyStrokeAction, hasKeyboardFocus, hasOpenPopups, hasSharedAnimationState, insertChild, invalidateLayout, invalidateLayoutLocally, isAbsoluteTheme, isClip, isDepthFocusTraversal, isEnabled, isFocusKeyEnabled, isInside, isLocallyEnabled, isMouseInside, isVisible, keyboardFocusChildChanged, layoutChildFullInnerArea, layoutChildrenFullInnerArea, moveChild, paint, paintBackground, paintChild, paintChildren, paintDragOverlay, paintOverlay, paintWidget, positionChanged, reapplyTheme, removeAllChildren, removeChild, removeChild, removePropertyChangeListener, removePropertyChangeListener, requestKeyboardFocus, requestKeyboardFocus, resetTooltip, setActionMap, setBackground, setBorderSize, setBorderSize, setBorderSize, setBorderSize, setCanAcceptKeyboardFocus, setClip, setDepthFocusTraversal, setEnabled, setFocusKeyEnabled, setInnerSize, setInputMap, setMaxSize, setMinSize, setMouseCursor, setOffscreenExtra, setOffscreenExtra, setOverlay, setPosition, setRenderOffscreen, setSize, setTheme, setTintAnimator, sizeChanged, updateTintAnimation, updateTooltip, validateLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueAdjusterFloat

public ValueAdjusterFloat()

ValueAdjusterFloat

public ValueAdjusterFloat(FloatModel model)
Method Detail

getMaxValue

public float getMaxValue()

getMinValue

public float getMinValue()

setMinMaxValue

public void setMinMaxValue(float minValue,
                           float maxValue)

getValue

public float getValue()

setValue

public void setValue(float value)

getStepSize

public float getStepSize()

setStepSize

public void setStepSize(float stepSize)
Sets the step size for the value adjuster. It must be > 0. Default is 1.0f.

Parameters:
stepSize - the new step size
Throws:
java.lang.IllegalArgumentException - if stepSize is NaN or <= 0.

getModel

public FloatModel getModel()

setModel

public void setModel(FloatModel model)

getFormat

public java.lang.String getFormat()

setFormat

public void setFormat(java.lang.String format)
               throws java.util.IllegalFormatException
Throws:
java.util.IllegalFormatException

getLocale

public java.util.Locale getLocale()

setLocale

public void setLocale(java.util.Locale locale)

onEditStart

protected java.lang.String onEditStart()
Specified by:
onEditStart in class ValueAdjuster

onEditEnd

protected boolean onEditEnd(java.lang.String text)
Specified by:
onEditEnd in class ValueAdjuster

validateEdit

protected java.lang.String validateEdit(java.lang.String text)
Specified by:
validateEdit in class ValueAdjuster

onEditCanceled

protected void onEditCanceled()
Specified by:
onEditCanceled in class ValueAdjuster

shouldStartEdit

protected boolean shouldStartEdit(char ch)
Specified by:
shouldStartEdit in class ValueAdjuster

onDragStart

protected void onDragStart()
Specified by:
onDragStart in class ValueAdjuster

onDragUpdate

protected void onDragUpdate(int dragDelta)
Specified by:
onDragUpdate in class ValueAdjuster

onDragCancelled

protected void onDragCancelled()
Specified by:
onDragCancelled in class ValueAdjuster

doDecrement

protected void doDecrement()
Specified by:
doDecrement in class ValueAdjuster

doIncrement

protected void doIncrement()
Specified by:
doIncrement in class ValueAdjuster

formatText

protected java.lang.String formatText()
Specified by:
formatText in class ValueAdjuster

parseText

protected float parseText(java.lang.String value)
                   throws java.text.ParseException
Throws:
java.text.ParseException

syncWithModel

protected void syncWithModel()
Specified by:
syncWithModel in class ValueAdjuster

afterAddToGUI

protected void afterAddToGUI(GUI gui)
Description copied from class: Widget
Called after this widget has been added to a GUI tree.

Overrides:
afterAddToGUI in class ValueAdjuster
Parameters:
gui - the GUI object - same as getGUI()
See Also:
Widget.getGUI()

beforeRemoveFromGUI

protected void beforeRemoveFromGUI(GUI gui)
Description copied from class: Widget
Called when this widget is removed from the GUI tree. After this call getGUI() will return null.

Overrides:
beforeRemoveFromGUI in class ValueAdjuster
Parameters:
gui - the GUI object - same as getGUI()
See Also:
Widget.getGUI()

removeModelCallback

protected void removeModelCallback()

addModelCallback

protected void addModelCallback()