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

Package class diagram package GroupModel
java.lang.Object
  extended by org.universAAL.ui.handler.gui.swing.model.Model
      extended by org.universAAL.ui.handler.gui.swing.model.FormControl.GroupModel
Direct Known Subclasses:
GroupLAF, GroupLAF, GroupLAF, GroupPanelModel, GroupTabbedPanelModel, RepeatModel

public abstract class GroupModel
extends Model

Author:
amedrano
See Also:
Group

Field Summary
protected  List children
          List of Models for children of this group.
 
Fields inherited from class org.universAAL.ui.handler.gui.swing.model.Model
fc, FORM_CONTROL_IN_TABLE, jc, label, needsLabel, needsPostNewLine, needsPreNewLine
 
Constructor Summary
GroupModel(Group control, Renderer render)
          Constructor.
 
Method Summary
protected  void addComponentTo(FormControl fc, Container c)
          Access to the Model mapper.
 boolean containsOnlySubGroups()
          Tell whether the form control contain only groups.
 Model findChildModeFor(String formControlURI)
          Find the Model for the FormControl with the given URI.
protected  JComponent getComponentFrom(FormControl fc)
          Access to the Model mapper.
abstract  JComponent getNewComponent()
          The JComponent returned may be either a JPanel a JTabbedPane depending on the complexity (and other factors) of the group
 boolean isTheIOGroup()
          check whether it is the io root group.
 boolean isTheMainGroup()
          check whether it is the system root group.
 boolean isTheSubmitGroup()
          check whether it is the submit root group.
 boolean isValid()
          Test if the JComponent information provided by the user is valid according to the FormControl's definition.
 void update()
          Adds all the needed information to the rendered component (in Model view).
 
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

children

protected List children
List of Models for children of this group.

Constructor Detail

GroupModel

public GroupModel(Group control,
                  Renderer render)
Constructor.

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

getNewComponent

public abstract JComponent getNewComponent()
The JComponent returned may be either depending on the complexity (and other factors) of the group

Specified by:
getNewComponent in class Model
Returns:
always a simple Jpanel() (LAFs should decide which to use).

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

update

public void update()
Adds all the needed information to the rendered component (in Model view). In LAF view, it add/updates all LAF components.

Overrides:
update in class Model

isTheSubmitGroup

public boolean isTheSubmitGroup()
check whether it is the submit root group.

Returns:
true is it is.

isTheMainGroup

public boolean isTheMainGroup()
check whether it is the system root group.

Returns:
true is it is.

isTheIOGroup

public boolean isTheIOGroup()
check whether it is the io root group.

Returns:
true is it is.

getComponentFrom

protected JComponent getComponentFrom(FormControl fc)
Access to the Model mapper. it will load the JComponent for a given FormControl which is a child of the current group. Adds the located Model to the list of children.

Parameters:
fc - the child from which to obtain it's model and JComponent
Returns:
the JComponent build by the Model of the child

addComponentTo

protected void addComponentTo(FormControl fc,
                              Container c)
Access to the Model mapper. it will load the JComponent for a given FormControl which is a child of the current group, and add it to a Container. Adds the located Model to the list of children.

Parameters:
fc - the child from which to obtain it's model and JComponent
c - the Container to which to add the JComponent

findChildModeFor

public Model findChildModeFor(String formControlURI)
Find the Model for the FormControl with the given URI.

Parameters:
formControlURI -
Returns:
the model or null if not found.

containsOnlySubGroups

public boolean containsOnlySubGroups()
Tell whether the form control contain only groups.

Parameters:
fc -
Returns:


Copyright © 2014 universAAL Consortium. All Rights Reserved.