fi.hut.tml.xsmiles.mlfc.xforms.adaptive
Class RangeDecimal

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.xforms.adaptive.AbstractControl
      extended byfi.hut.tml.xsmiles.mlfc.xforms.adaptive.AbstractRange
          extended byfi.hut.tml.xsmiles.mlfc.xforms.adaptive.RangeDecimal
All Implemented Interfaces:
java.awt.event.AdjustmentListener, Control, java.util.EventListener, FormControl, TypedElement, XFormsConstants
Direct Known Subclasses:
RangeInteger

public class RangeDecimal
extends AbstractRange
implements java.awt.event.AdjustmentListener, XFormsConstants

implements range control for decimal values


Field Summary
protected  java.math.BigDecimal end
           
protected  XRange fRange
           
protected  int maxscale
           
protected  int numsteps
           
protected  java.math.BigDecimal realstep
           
protected  java.math.BigDecimal scale
           
protected  java.math.BigDecimal start
           
protected  java.math.BigDecimal step
           
 
Fields inherited from class fi.hut.tml.xsmiles.mlfc.xforms.adaptive.AbstractRange
element
 
Fields inherited from class fi.hut.tml.xsmiles.mlfc.xforms.adaptive.AbstractControl
fActionListener, fChangeListener, fContext, insideEvent, ownerElem
 
Fields inherited from interface fi.hut.tml.xsmiles.mlfc.xforms.XFormsConstants
ACCESSKEY, ACTION_ATTRIBUTE, ACTION_ELEMENT, ACTIVATE_EVENT, ACTIVE_CASE_PSEUDOCLASS, ALERT_ELEMENT, ALERT_EVENT, APPEARANCE_ATTRIBUTE, AT_ATTRIBUTE, BasicDataFactoryClassName, BEFORE_ATTRIBUTE, BIND_ATTRIBUTE, BIND_ELEMENT, BINDING_EXCEPTION, BLUR_EVENT, BUBBLES_ATTRIBUTE, BUTTON_ELEMENT, CALCULATE_ATTRIBUTE, CANCELABLE_ATTRIBUTE, CAPTION_CHANGED, CAPTION_ELEMENT, CASE_ATTRIBUTE, CASE_ELEMENT, CDATA_SECTION_ELEMENTS_ATTRIBUTE, CHOICES_ELEMENT, COMPUTE_EXCEPTION, CONSTRAINT_ATTRIBUTE, CONTROL_ATTRIBUTE, COPY_ELEMENT, DELETE_ELEMENT, DELETE_EVENT, DESELECT_EVENT, DESTROY_ELEMENT, DESTROY_EVENT, DISABLED_EVENT, DISABLED_PSEUDOCLASS, DISPATCH_ELEMENT, DUPLICATE_ELEMENT, DUPLICATE_EVENT, ENABLED_EVENT, ENABLED_PSEUDOCLASS, ENCODING_ATTRIBUTE, END_ATTRIBUTE, EXTENSION, EXTERNAL_LINKING_ATTR, FILENAME, FILENAME_ELEMENT, FOCUS_EVENT, FOCUSIN_NOTIFICATION_EVENT, FOCUSOUT_NOTIFICATION_EVENT, FUNC_INDEX, FUNC_NODEINDEX, FUNCTIONS_ATTRIBUTE, GROUP, GROUP_ELEMENT, HELP, HELP_ELEMENT, HELP_EVENT, HINT, HINT_ELEMENT, HINT_EVENT, INACTIVE_CASE_PSEUDOCLASS, INCLUDENAMESPACEPREFIXES_ATTRIBUTE, INCREMENTAL_ATTRIBUTE, INDENT_ATTRIBUTE, INDEX_ATTRIBUTE, INPUT, INPUT_ELEMENT, INPUTMODE_ATTRIBUTE, INRANGE_EVENT, INRANGE_PSEUDOCLASS, INSERT, INSERT_ELEMENT, INSERT_EVENT, INSTANCE, INSTANCE_ELEMENT, InstanceDocumentClassname, INVALID_DATATYPE_ERROR, INVALID_EVENT, INVALID_PSEUDOCLASS, ISVALID_ATTRIBUTE, ITEM, ITEM_ELEMENT, ITEMSET, ITEMSET_ELEMENT, LABEL, LEVEL_ATTRIBUTE, LINK_ERROR, LINK_EXCEPTION, LOAD, LOADURI_ELEMENT, MAXOCCURS_ATTRIBUTE, MEDIA_TYPE_ELEMENT, MEDIARENDERING_PSEUDOCLASS, MEDIATYPE, MEDIATYPE_ATTRIBUTE, MESSAGE, MESSAGE_ELEMENT, METHOD_ATTRIBUTE, MINOCCURS_ATTRIBUTE, MODEL_ATTRIBUTE, MODEL_CONSTRUCT_DONE_EVENT, MODEL_CONSTRUCT_EVENT, MODEL_DESTRUCT_EVENT, MODEL_ELEMENT, MODEL_ID_ATTRIBUTE, NAME_ATTRIBUTE, NAVINDEX_ATTRIBUTE, NEXT_EVENT, NODESET_ATTRIBUTE, NUMBER_ATTRIBUTE, OMIT_XML_DECLARATION_ATTRIBUTE, OPTIONAL_EVENT, ORIGIN_ATTRIBUTE, OUTOFRANGE_EVENT, OUTOFRANGE_PSEUDOCLASS, OUTPUT_ELEMENT, P3PTYPE_ATTRIBUTE, POSITION_ATTRIBUTE, PREVIOUS_EVENT, PSVIDocumentClassname, PSVISchemaPoolClassName, RANGE, RANGE_ELEMENT, READONLY_ATTRIBUTE, READONLY_EVENT, READONLY_PSEUDOCLASS, READWRITE_EVENT, READWRITE_PSEUDOCLASS, READY_EVENT, REBUILD_ELEMENT, REBUILD_EVENT, RECALCULATE_ELEMENT, RECALCULATE_EVENT, REF_ATTRIBUTE, REFRESH_ELEMENT, REFRESH_EVENT, RELEVANT_ATTRIBUTE, REPEAT, REPEAT_ATTRIBUTE, REPEAT_BIND_ATTRIBUTE, REPEAT_ELEMENT, REPEAT_ID_ATTRIBUTE, REPEAT_MODEL_ATTRIBUTE, REPEAT_NODESET_ATTRIBUTE, REPEAT_NUMBER_ATTRIBUTE, REPEAT_STARTINDEX_ATTRIBUTE, REPLACE_ALL, REPLACE_ATTRIBUTE, REPLACE_INSTANCE, REPLACE_NEW, REPLACE_NONE, REQUIRED_ATTRIBUTE, REQUIRED_EVENT, RESET, RESET_ELEMENT, RESET_EVENT, RESOURCE_ATTRIBUTE, RESOURCE_LINKING_ATTR, REVALIDATE, REVALIDATE_ELEMENT, REVALIDATE_EVENT, SCHEMA_ATTRIBUTE, SCHEMA_CONSTRAINTS_ERROR, SCHEMA_ELEMENT, SCROLL_FIRST_EVENT, SCROLL_LAST_EVENT, SECRET, SECRET_ELEMENT, SELECT, SELECT_BOOLEAN_ELEMENT, SELECT_EVENT, SELECT_MANY_ELEMENT, SELECT_ONE_ELEMENT, SELECT1, SELECTED_ATTRIBUTE, SELECTION_ATTRIBUTE, SEND, SEPARATOR_ATTRIBUTE, SET_FOCUS_ELEMENT, SET_INDEX_ELEMENT, SETFOCUS, SETINDEX, SETVALUE, SETVALUE_ELEMENT, SHOW_ATTR, SHOW_ATTRIBUTE, SHOW_NEW, SHOW_REPLACE, SRC_ATTRIBUTE, STANDALONE_ATTRIBUTE, START_ATTRIBUTE, STARTINDEX_ATTRIBUTE, STEP_ATTRIBUTE, SUBMISSION, SUBMISSION_ATTRIBUTE, SUBMIT, SUBMIT_DONE_EVENT, SUBMIT_ELEMENT, SUBMIT_ERROR, SUBMIT_EVENT, SUBMIT_INFO_ATTRIBUTE, SUBMIT_INFO_ELEMENT, SUBMIT_INSTANCE_ELEMENT, SUBMIT_STARTED_EVENT, SUBTREE_MODIFY_END, SUBTREE_MODIFY_START, SWITCH, SWITCH_ELEMENT, TARGET_ATTRIBUTE, TEXTAREA, TEXTAREA_ELEMENT, TOGGLE, TOGGLE_ELEMENT, TRAVERSAL_ERROR, TREE_ELEMENT, TRIGGER, TYPE_ATTRIBUTE, UI_INITIALIZE_EVENT, UPLOAD, UPLOAD_ELEMENT, VALID_EVENT, VALID_PSEUDOCLASS, VALUE, VALUE_ATTRIBUTE, VALUE_CHANGED_EVENT, VALUE_CHANGING_EVENT, VALUE_ELEMENT, VERSION_ATTRIBUTE, XercesPSVIClassName, XFORMS_NS, XFormsConfigurationPSVI, XHTML_NS, XSMILES_MESSAGE_SHOWN_EVENT
 
Constructor Summary
RangeDecimal(XFormsContext context, org.w3c.dom.Element elem)
           
 
Method Summary
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent adjustmentEvent)
          event handler for slider adjustements
protected  void checkRange()
           
protected  java.math.BigDecimal convertFromRangeValue(int i)
           
protected  java.math.BigDecimal convertToBigDecimal(java.lang.String str, java.lang.String def)
           
protected  int convertToRangeValue(java.lang.Object obj)
           
protected  void createControl()
           
protected  java.util.Hashtable createLabelTable()
           
 void destroy()
          close up, free all memory (yet, do not do visible changes, such as setVisible since this will slow things up
protected  void DispatchInRange()
           
protected  void DispatchOutOfRange()
           
protected  int findmaxscale()
           
 XComponent getComponent()
          returns the abstract component for this control.
protected  int getEnd()
           
protected  java.math.BigDecimal getEndAttrValue()
           
protected  int getNumberOfSteps()
           
protected  int getStart()
           
protected  java.math.BigDecimal getStartAttrValue()
           
protected  java.math.BigDecimal getStepAttrValue()
           
protected  int getStepsize()
           
 Data getValue()
          get the components current value
protected  boolean isInRange()
           
protected  void registerListener()
          internal method for setting the listener for the component
 void updateDisplay()
          this function is used to notify the control to update its display according to the content of Data
 
Methods inherited from class fi.hut.tml.xsmiles.mlfc.xforms.adaptive.AbstractControl
activate, activate, addActionListener, addChangeListener, getData, getDataType, isInputControl, isWritable, rewiringAboutToHappen, setData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fRange

protected XRange fRange

start

protected java.math.BigDecimal start

end

protected java.math.BigDecimal end

step

protected java.math.BigDecimal step

realstep

protected java.math.BigDecimal realstep

scale

protected java.math.BigDecimal scale

numsteps

protected int numsteps

maxscale

protected int maxscale
Constructor Detail

RangeDecimal

public RangeDecimal(XFormsContext context,
                    org.w3c.dom.Element elem)
Method Detail

createControl

protected void createControl()

getStart

protected int getStart()

getEnd

protected int getEnd()

getStepsize

protected int getStepsize()

createLabelTable

protected java.util.Hashtable createLabelTable()

getStartAttrValue

protected java.math.BigDecimal getStartAttrValue()

getEndAttrValue

protected java.math.BigDecimal getEndAttrValue()

getStepAttrValue

protected java.math.BigDecimal getStepAttrValue()

convertToBigDecimal

protected java.math.BigDecimal convertToBigDecimal(java.lang.String str,
                                                   java.lang.String def)

getNumberOfSteps

protected int getNumberOfSteps()

findmaxscale

protected int findmaxscale()

convertToRangeValue

protected int convertToRangeValue(java.lang.Object obj)

convertFromRangeValue

protected java.math.BigDecimal convertFromRangeValue(int i)

getComponent

public XComponent getComponent()
returns the abstract component for this control. The abstract component can be used e.g. to style the component but all listeners should be added to the AdaptiveControl and not directly to the XComponent

Specified by:
getComponent in interface Control

registerListener

protected void registerListener()
internal method for setting the listener for the component


destroy

public void destroy()
Description copied from class: AbstractControl
close up, free all memory (yet, do not do visible changes, such as setVisible since this will slow things up

Specified by:
destroy in interface Control
Overrides:
destroy in class AbstractControl

updateDisplay

public void updateDisplay()
this function is used to notify the control to update its display according to the content of Data

Specified by:
updateDisplay in interface Control

checkRange

protected void checkRange()

isInRange

protected boolean isInRange()

DispatchOutOfRange

protected void DispatchOutOfRange()

DispatchInRange

protected void DispatchInRange()

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent adjustmentEvent)
event handler for slider adjustements

Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener

getValue

public Data getValue()
get the components current value

Specified by:
getValue in interface Control


X-Smiles 1.2