org.universAAL.ui.handler.gui.swing.model.FormControl
Class RangeModel
java.lang.Object
org.universAAL.ui.handler.gui.swing.model.Model
org.universAAL.ui.handler.gui.swing.model.FormControl.InputModel
org.universAAL.ui.handler.gui.swing.model.FormControl.RangeModel
- All Implemented Interfaces:
- EventListener, ChangeListener
- Direct Known Subclasses:
- RangeLAF, RangeLAF, RangeLAF
public abstract class RangeModel
- extends InputModel
- implements ChangeListener
- Author:
- amedrano
- See Also:
Range
Methods inherited from class org.universAAL.ui.handler.gui.swing.model.Model |
correspondsTo, getComponent, getLabelModel, getPositionInGroup, getRenderer, isInDialog, isInIOGroup, isInMainMenu, isInMessage, isInStandardGroup, isInSubDialog, isInSubmitGroup, isInTable, needsLabel, needsPostNewLine, needsPreNewLine, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RangeModel
public RangeModel(Range control,
Renderer render)
- Constructor.
- Parameters:
control
- the Range
which to model.
getNewComponent
public JComponent getNewComponent()
- Ranges can yield a
JSpinner
if the specified range
is less than a threshold, or it can also be JSlider
.
- Specified by:
getNewComponent
in class Model
- Returns:
- a
JComponent
initialised with the model's information,
isValid
public boolean isValid()
- Test if the
JComponent
information provided by the user is valid
according to the FormControl
's definition.
- Specified by:
isValid
in class Model
- Returns:
- true if the data has passed every restriction
stateChanged
public void stateChanged(ChangeEvent e)
- When a range is change, the input will be stored
- Specified by:
stateChanged
in interface ChangeListener
Copyright © 2014 universAAL Consortium. All Rights Reserved.