org.universAAL.ui.handler.gui.swing.model
Class FormModel

Package class diagram package FormModel
java.lang.Object
  extended by org.universAAL.ui.handler.gui.swing.model.FormModel
Direct Known Subclasses:
FormLAF, FormLAF, FormLAF

public abstract class FormModel
extends Object

Model for Forms, all FormLAF should extend this class which will provide the available panels (Standard, submits and IO). This model also provides other functionalities such as the parent tree construction for subdialogs. And antecessor query to check if a dialog is the parent tree of the form.

Author:
amedrano
See Also:
Form

Field Summary
protected  Form form
          Reference to RDF class.
static String IO_NAME
          The name set to IO panel.
protected  GroupModel ioGroupModel
          The model for the IOGroup.
static String SUB_NAME
          The name set to Submits panel.
protected  GroupModel submitsGroupModel
          the model for the submitsGroup.
static String SYS_NAME
          The name set to System buttons panel.
protected  GroupModel sysGroupModel
          The model for the systemGroup.
 
Constructor Summary
protected FormModel(Form f, Renderer renderer)
          Constructor for a given Form.
 
Method Summary
 void finalizeForm()
          Terminate the current dialog, close the frame, and unregister from FormModelMapper.
 Model findModel(String URI)
          Find the Model in the children corresponding to the FormControl's URI
 Form getForm()
          Get the Form related to this FormModel.
protected  JComponent getIOPanel()
          construct the IO Panel for the Form
protected  JComponent getIOPanel(int depth)
          Construct the IO Panel for the parent with given depth.
 Renderer getRenderer()
          Get the Renderer associated to this FormModel.
protected  UIRequest getRequest()
          Get the original Request.
 int getSubdialogLevel()
          Get the Depth of the current FormModel.
protected  JComponent getSubmitPanel()
          Construct the Submit Panel for the Form
protected  JComponent getSubmitPanel(int depth)
          Construct the Submit Panel for the parent with given depth.
protected  JComponent getSystemPanel()
          construct the System buttons Panel for the Form
 String[] getTitlePath()
          Get the list of all parent form titles.
 boolean isAntecessor(String uri)
          Checks if the URI represents any antecessor Form of the current FormModel.
 void setRequest(UIRequest request)
          Set the Original Request.
abstract  void showForm()
          Construct the Frame that displays the Form and make it visible.
protected abstract  void terminateDialog()
          Terminate the dialog, closing the frame, and any required procedure.
 void updateMissingInput(Input in)
          Finds the Model for the Input and instructs it to InputModel.updateAsMissing().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

form

protected Form form
Reference to RDF class.


ioGroupModel

protected GroupModel ioGroupModel
The model for the IOGroup.


sysGroupModel

protected GroupModel sysGroupModel
The model for the systemGroup.


submitsGroupModel

protected GroupModel submitsGroupModel
the model for the submitsGroup.


IO_NAME

public static final String IO_NAME
The name set to IO panel.

See Also:
Constant Field Values

SUB_NAME

public static final String SUB_NAME
The name set to Submits panel.

See Also:
Constant Field Values

SYS_NAME

public static final String SYS_NAME
The name set to System buttons panel.

See Also:
Constant Field Values
Constructor Detail

FormModel

protected FormModel(Form f,
                    Renderer renderer)
Constructor for a given Form. Retrieves the parent (if there is any) and computes the depth. Registers the form in the FormModelMapper to be retrieved by successors.

Parameters:
f - The Form for which the model is constructed.
renderer - The Renderer used to access FormManager and ModelMapper
Method Detail

showForm

public abstract void showForm()
Construct the Frame that displays the Form and make it visible.


terminateDialog

protected abstract void terminateDialog()
Terminate the dialog, closing the frame, and any required procedure.


finalizeForm

public void finalizeForm()
Terminate the current dialog, close the frame, and unregister from FormModelMapper.


getForm

public Form getForm()
Get the Form related to this FormModel.

Returns:
the Form

isAntecessor

public boolean isAntecessor(String uri)
Checks if the URI represents any antecessor Form of the current FormModel.

Parameters:
uri - candidate antecessor's URI
Returns:
true if uri is equal or an antecessor of the current FormModel.

getIOPanel

protected JComponent getIOPanel()
construct the IO Panel for the Form

Returns:
a JPanel with all the components inside Form.getIOControls() group.

getSystemPanel

protected JComponent getSystemPanel()
construct the System buttons Panel for the Form

Returns:
a JPanel with all the components inside Form.getStandardButtons() group.

getSubmitPanel

protected JComponent getSubmitPanel()
Construct the Submit Panel for the Form

Returns:
a JPanel with all the components inside Form.getSubmits() group.

getIOPanel

protected JComponent getIOPanel(int depth)
Construct the IO Panel for the parent with given depth.

Parameters:
depth - the desired depth.
Returns:
a JPanel with all the components inside Form.getIOControls() group of the antecessor.
See Also:
subDialogLevel, getIOPanel()

getSubmitPanel

protected JComponent getSubmitPanel(int depth)
Construct the Submit Panel for the parent with given depth.

Parameters:
depth - the desired depth.
Returns:
a JPanel with all the components inside Form.getSubmits() group of the antecessor.
See Also:
subDialogLevel, getSubmitPanel()

getSubdialogLevel

public int getSubdialogLevel()
Get the Depth of the current FormModel.

Returns:
depth (A.K.A subdialogLevel)
See Also:
subDialogLevel

getRenderer

public Renderer getRenderer()
Get the Renderer associated to this FormModel.

Returns:
the Renderer

getTitlePath

public String[] getTitlePath()
Get the list of all parent form titles.

Returns:
an array of titles, the first one being the farthest ancestor and the last being the current form's title.

setRequest

public void setRequest(UIRequest request)
Set the Original Request.

Parameters:
request -

getRequest

protected UIRequest getRequest()
Get the original Request.

Returns:

updateMissingInput

public void updateMissingInput(Input in)
Finds the Model for the Input and instructs it to InputModel.updateAsMissing().

Parameters:
in -

findModel

public Model findModel(String URI)
Find the Model in the children corresponding to the FormControl's URI

Parameters:
URI - the URI of the FormControl to find the model for.
Returns:
the model if found, null otherwise.


Copyright © 2014 universAAL Consortium. All Rights Reserved.