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

Package class diagram package SelectModel
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.SelectModel
All Implemented Interfaces:
EventListener, ListSelectionListener
Direct Known Subclasses:
Select1Model, SelectChecboxModel, SelectLAF, SelectLAF, SelectLAF

public abstract class SelectModel
extends InputModel
implements ListSelectionListener

Author:
amedrano
See Also:
Select

Nested Class Summary
protected  class SelectModel.SelectionTreeModel
          the TreeModel for generating a JTree.
 
Field Summary
protected  ArrayList selected
          the selected items
 
Fields inherited from class org.universAAL.ui.handler.gui.swing.model.Model
fc, FORM_CONTROL_IN_TABLE, jc, label, needsLabel, needsPostNewLine, needsPreNewLine
 
Constructor Summary
SelectModel(Select control, Renderer render)
          Constructor.
 
Method Summary
 JComponent getNewComponent()
          generate the JComponent that displays this FormControl's information.
 boolean isValid()
          Test if the JComponent information provided by the user is valid according to the FormControl's definition.
protected  void setSelected()
           
 void update()
          Update the selections
 void valueChanged(ListSelectionEvent e)
          
 
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
 

Field Detail

selected

protected ArrayList selected
the selected items

Constructor Detail

SelectModel

public SelectModel(Select control,
                   Renderer render)
Constructor.

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

getNewComponent

public JComponent getNewComponent()
generate the JComponent that displays this FormControl's information.

Specified by:
getNewComponent in class Model
Returns:
either a JList or a JTree

update

public void update()
Update the selections

Overrides:
update in class Model

setSelected

protected void setSelected()

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

valueChanged

public void valueChanged(ListSelectionEvent e)

Specified by:
valueChanged in interface ListSelectionListener


Copyright © 2014 universAAL Consortium. All Rights Reserved.