|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.middleware.rdf.Resource
org.universAAL.middleware.rdf.FinalizedResource
org.universAAL.middleware.ui.rdf.FormElement
org.universAAL.middleware.ui.rdf.FormControl
org.universAAL.middleware.ui.rdf.Input
org.universAAL.middleware.ui.rdf.Range
public class Range
A range control should be used as placeholder for such user input that must belong to an ordered set of values between a known minimum value and a known maximum value. These characteristics of the expected user input must be derivable from the value restrictions, either the model-based restrictions (those that can be extracted from form data) or those explicitly passed as parameter to the constructor. Additionally, a "step" (a number - defaults to 1) can be specified for determining a next or previous value relative to a given value.
The type of the values (which will be derived from the value restrictions)
must be a subclass of either
ComparableIndividual
(only those with
ordinal characteristics that do not return null in the implementation of
related methods) or a number (double, float, int or long). However, numbers
can be used only if the value restrictions are specified with the help of
BoundedValueRestriction
. Other classes
that implement Comparable
are not supported because there
is no straightforward solution to determine the next or previous values based
on a step.
Field Summary | |
---|---|
static String |
MY_URI
|
static String |
PROP_STEP
a positive number (defaults to 1) for determining a next or previous value relative to a given value. |
Fields inherited from class org.universAAL.middleware.ui.rdf.Input |
---|
PROP_INPUT_ALERT, PROP_IS_MANDATORY |
Fields inherited from class org.universAAL.middleware.ui.rdf.FormControl |
---|
PROP_CONTROL_LABEL, PROP_HELP, PROP_HINT, PROP_PARENT_CONTROL, PROP_REFERENCED_PPATH, PROP_VALUE_RESTRICTION |
Fields inherited from class org.universAAL.middleware.ui.rdf.FormElement |
---|
PROP_APPEARANCE |
Fields inherited from class org.universAAL.middleware.rdf.Resource |
---|
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, ns_delim_index, PROP_RDF_FIRST, PROP_RDF_REST, PROP_RDF_TYPE, PROP_RDFS_COMMENT, PROP_RDFS_LABEL, PROP_SERIALIZATION_FULL, PROP_SERIALIZATION_OPTIONAL, PROP_SERIALIZATION_REDUCED, PROP_SERIALIZATION_UNDEFINED, PROP_uAAL_INVOLVED_HUMAN_USER, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uAAL_NAMESPACE_PREFIX, uAAL_SERVICE_NAMESPACE, uAAL_VOCABULARY_NAMESPACE, uri |
Constructor Summary | |
---|---|
Range()
For exclusive use of de-serializers. |
|
Range(Group parent,
Label label,
PropertyPath ref,
MergedRestriction valueRestriction,
Object initialValue)
Constructs a new range control. |
Method Summary | |
---|---|
int |
getMaxLength()
Overrides FormControl.getMaxLength() by returning always -1,
because no standard string representation of a range control exists. |
Comparable |
getMaxValue()
|
Comparable |
getMinValue()
|
int |
getRangeLength()
Using the value of PROP_STEP , returns the number of steps
between the min and max values. |
Number |
getStep()
|
int |
getStepsValue()
Using the current value stored in this range control and the value of PROP_STEP , tries to calculate the number of steps that separate the current
value and minimun value. |
boolean |
setProperty(String propURI,
Object value)
For usage by de-serializers. |
boolean |
setStep(Number step)
|
Comparable |
shiftValue(int numberOfSteps)
Using the current value stored in this range control and the value of PROP_STEP , tries to calculate a new value that is then stored to
substitute the current value. |
Comparable |
stepValue(int numberOfStepsFormMin)
Using the current value stored in this range control and the value of PROP_STEP , tries to calculate a new value form the steps from min
value. |
Methods inherited from class org.universAAL.middleware.ui.rdf.Input |
---|
getAlertString, isMandatory, setAlertString, storeUserInput |
Methods inherited from class org.universAAL.middleware.ui.rdf.FormControl |
---|
getAncestorRepeat, getFormObject, getHelpString, getHintString, getLabel, getParentGroup, getParentRepeat, getReferencedPPath, getRestrictions, getSuperGroups, getTypeURI, getValue, hasFocus, hasValue, isOfBooleanType, isOfPrimitiveType, isRepeatable, setHelpString, setHintString, toString |
Methods inherited from class org.universAAL.middleware.ui.rdf.FormElement |
---|
addAppearanceRecommendation, getAppearanceRecommendations |
Methods inherited from class org.universAAL.middleware.rdf.FinalizedResource |
---|
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties |
Methods inherited from class org.universAAL.middleware.rdf.Resource |
---|
addMultiLangProp, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getPropSerializationType, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, isWellFormed, literal, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toStringRecursive, toStringRecursive, unliteral |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String MY_URI
public static final String PROP_STEP
Constructor Detail |
---|
public Range()
public Range(Group parent, Label label, PropertyPath ref, MergedRestriction valueRestriction, Object initialValue)
parent
- The mandatory parent group as the direct container of this
input field. See FormControl.PROP_PARENT_CONTROL
.label
- The optional Label
to be associated with this input
field. See FormControl.PROP_CONTROL_LABEL
.ref
- See FormControl.PROP_REFERENCED_PPATH
; mandatory.valueRestriction
- See FormControl.PROP_VALUE_RESTRICTION
; optional.initialValue
- The optional initial value to be stored in form data under the
path given for the above ref
parameter.Method Detail |
---|
public int getMaxLength()
FormControl.getMaxLength()
by returning always -1,
because no standard string representation of a range control exists.
getMaxLength
in class FormControl
public Comparable getMaxValue()
public Comparable getMinValue()
public Comparable shiftValue(int numberOfSteps)
PROP_STEP
, tries to calculate a new value that is then stored to
substitute the current value.
numberOfSteps
- Number of sttp. Will be multiplied by the value of
PROP_STEP
in oer to calculate theamount o requied
shift. If positive, the shift will be towards max value;
otherwise towards min value.
public int getStepsValue()
PROP_STEP
, tries to calculate the number of steps that separate the current
value and minimun value.
getRangeLength()
).getRangeLength()
,
stepValue(int)
public Comparable stepValue(int numberOfStepsFormMin)
PROP_STEP
, tries to calculate a new value form the steps from min
value.
Helper method for UIHandler
s.
numberOfStepsFormMin
- Number of steps. Will be multiplied by the value of
PROP_STEP
in oder to calculate the new amount,
it must be between 0 and getRangeLength()
-1.
getRangeLength()
,
getStepsValue()
public int getRangeLength()
PROP_STEP
, returns the number of steps
between the min and max values.
public Number getStep()
PROP_STEP
public boolean setStep(Number step)
PROP_STEP
public boolean setProperty(String propURI, Object value)
FormControl
setProperty
in class Input
Input.setProperty(String, Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |