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

Package class diagram package InputFieldModel
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.InputFieldModel
All Implemented Interfaces:
ActionListener, EventListener, CaretListener, ChangeListener
Direct Known Subclasses:
InputFieldLAF, InputFieldLAF, InputFieldLAF

public abstract class InputFieldModel
extends InputModel
implements ChangeListener, CaretListener, ActionListener

ImputField Model, it condenses the view and controller parts of the MVC methodology.

Author:
amedrano
See Also:
InputField

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
InputFieldModel(InputField control, Renderer render)
          Constructor.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Input will be stored each time the user changes the status of an Input
 void caretUpdate(CaretEvent e)
          Input will be stored each time the user types something in the text field.
 JComponent getNewComponent()
          the representation for InputField can either be a JCheckBox if the FormControl.getValue() is a boolean type a JTextField if the FormControl.getValue() is a String and not secret a JPasswordField if the FormControl.getValue() is String and it is secret a ??
 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 checkbox is pressed the input will be stored.
 void update()
          Updating the InputField
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputFieldModel

public InputFieldModel(InputField control,
                       Renderer render)
Constructor.

Parameters:
control - de InputField which to model.
Method Detail

getNewComponent

public JComponent getNewComponent()
the representation for InputField can either be

Specified by:
getNewComponent in class Model
Returns:
a JComponent initialised with the model's information,

update

public void update()
Updating the InputField

Overrides:
update in class Model

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 checkbox is pressed the input will be stored.

Specified by:
stateChanged in interface ChangeListener
Parameters:
e - the ChangeEvent to listen to.

caretUpdate

public void caretUpdate(CaretEvent e)
Input will be stored each time the user types something in the text field.

Specified by:
caretUpdate in interface CaretListener
Parameters:
e - the CaretEvent to listen to.

actionPerformed

public void actionPerformed(ActionEvent e)
Input will be stored each time the user changes the status of an Input

Specified by:
actionPerformed in interface ActionListener


Copyright © 2014 universAAL Consortium. All Rights Reserved.