org.universAAL.support.utils.ui
Class SelectRange

Package class diagram package SelectRange
java.lang.Object
  extended by org.universAAL.support.utils.ui.Control
      extended by org.universAAL.support.utils.ui.InputControl
          extended by org.universAAL.support.utils.ui.SelectRange

public class SelectRange
extends InputControl

Class representing a Range Input UI element. Range Inputs get a numeric value within a range, whether it's a spinner, slider or any other way, depending on the UI renderer. The input is represented as an Integer.

Example render:

 Label min[---|--------]max 
         initialValue
 

Author:
alfiva

Field Summary
 
Fields inherited from class org.universAAL.support.utils.ui.InputControl
model
 
Fields inherited from class org.universAAL.support.utils.ui.Control
help, hint, label, MY_NAMESPACE, ref
 
Constructor Summary
SelectRange()
          Generic empty constructor.
SelectRange(String ref)
          Constructor with the reference of the input to be used in request and response.
SelectRange(String ref, String label)
          Constructor with the reference of the input to be used in request and response.
SelectRange(String ref, String label, int min, int max, int initialValue)
          Constructor with the reference of the input to be used in request and response.
 
Method Summary
 String[] create(Group group)
          This method is for internal use of utils only.
 Integer getInitialValue()
          Get the initial value of the range, between min and max.
 Integer getMax()
          Get the maximum value of the range.
 Integer getMin()
          Get the minimum value of the range.
 Integer getStep()
          Get the amount which the value increases or decreases with every step.
 void setInitialValue(int initialValue)
          Set the initial value of the range, between min and max.
 void setMax(int max)
          Set the maximum value of the range.
 void setMin(int min)
          Set the minimum value of the range.
 void setMinMaxInitial(int min, int max, int initialValue)
          Set the minimum and maximum values of the range, and the initial value within them.
 void setStep(int step)
          Set the amount which the value increases or decreases with every step.
 
Methods inherited from class org.universAAL.support.utils.ui.InputControl
getModel
 
Methods inherited from class org.universAAL.support.utils.ui.Control
getHelp, getHint, getLabel, getReference, setHelp, setHint, setLabel, setReference, setReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectRange

public SelectRange()
Generic empty constructor. The Input will be generated with default values (0 to 1).


SelectRange

public SelectRange(String ref)
Constructor with the reference of the input to be used in request and response. The reference is a property path, but in this constructor it is simplified as a single String (a single-property path). All other properties of the input are set to defaults (0 to 1). Use method setReference(String[] path) to set a path through several properties.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.

SelectRange

public SelectRange(String ref,
                   String label)
Constructor with the reference of the input to be used in request and response. The reference is a property path, but in this constructor it is simplified as a single String (a single-property path). Use method setReference(String[] path) to set a path through several properties.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the input to the user.

SelectRange

public SelectRange(String ref,
                   String label,
                   int min,
                   int max,
                   int initialValue)
Constructor with the reference of the input to be used in request and response. The reference is a property path, but in this constructor it is simplified as a single String (a single-property path). Use method setReference(String[] path) to set a path through several properties.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the input to the user.
min - The low end of the range that the value can get (inclusive)
max - The high end of the range that the value can get (inclusive)
initialValue - The value the range input has by default, between min and max. If it is not changed by the user this will be the value of the input in the response.
Method Detail

create

public String[] create(Group group)
Description copied from class: Control
This method is for internal use of utils only. It creates the actual official uaal control configured with the properties defined by this class. Once it is created it cannot be modified.

Specified by:
create in class Control
Parameters:
group - The UI group to which the control is being added.
Returns:
An array of Strings representing the property path used to identify the control in the response. This is only of interest for Input Controls. Submits and Triggers have only one String value. If the path has not been set manually by the time this method is called, an automatic one must be generated.

getMin

public Integer getMin()
Get the minimum value of the range.

Returns:
The minimum value

setMin

public void setMin(int min)
Set the minimum value of the range.

Parameters:
min - The minimum value

getInitialValue

public Integer getInitialValue()
Get the initial value of the range, between min and max.

Returns:
The initial value

setInitialValue

public void setInitialValue(int initialValue)
Set the initial value of the range, between min and max.

Parameters:
initialValue - The initial value

getMax

public Integer getMax()
Get the maximum value of the range.

Returns:
The maximum value

setMax

public void setMax(int max)
Set the maximum value of the range.

Parameters:
max - The maximum value

getStep

public Integer getStep()
Get the amount which the value increases or decreases with every step.

Returns:
The step value

setStep

public void setStep(int step)
Set the amount which the value increases or decreases with every step.

Parameters:
step - The step value

setMinMaxInitial

public void setMinMaxInitial(int min,
                             int max,
                             int initialValue)
Set the minimum and maximum values of the range, and the initial value within them. The method does not check the validity, it is only checked when the control is added.

Parameters:
min - The minimum value
max - The maximum value
initialValue - The initial value


Copyright © 2014 universAAL Consortium. All Rights Reserved.