org.universAAL.ui.handler.gui.swing.model.FormControl
Class RangeModel

Package class diagram package RangeModel
java.lang.Object
  extended by org.universAAL.ui.handler.gui.swing.model.Model
      extended by org.universAAL.ui.handler.gui.swing.model.FormControl.InputModel
          extended by 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

Field Summary
 
Fields inherited from class org.universAAL.ui.handler.gui.swing.model.Model
fc, FORM_CONTROL_IN_TABLE, jc, label, needsLabel, needsPostNewLine, needsPreNewLine
 
Constructor Summary
RangeModel(Range control, Renderer render)
          Constructor.
 
Method Summary
 JComponent getNewComponent()
          Ranges can yield a JSpinner if the specified range is less than a threshold, or it can also be JSlider.
 boolean isValid()
          Test if the JComponent information provided by the user is valid according to the FormControl's definition.
 void stateChanged(ChangeEvent e)
          When a range is change, the input will be stored
 
Methods inherited from class org.universAAL.ui.handler.gui.swing.model.FormControl.InputModel
getAlertString, isMandatory, isOfType, updateAsMissing
 
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
 

Constructor Detail

RangeModel

public RangeModel(Range control,
                  Renderer render)
Constructor.

Parameters:
control - the Range which to model.
Method Detail

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.