org.universAAL.ui.handler.gui.swing.formManagement
Class QueuedFormManager

Package class diagram package QueuedFormManager
java.lang.Object
  extended by org.universAAL.ui.handler.gui.swing.formManagement.QueuedFormManager
All Implemented Interfaces:
FormManager

public final class QueuedFormManager
extends Object
implements FormManager

This FormManager queues the UIRequests in a priority queue according to the dialog's priority. And displays the most prioritarial UIRequest. Message type dialogs don't enter the priority queue.

Author:
amedrano
See Also:
UIRequestPriorityComparator

Field Summary
static int QUEUE_MAX
          Maximum # dialogs to be queued
 
Constructor Summary
QueuedFormManager()
          Default constructor.
 
Method Summary
 void adaptationParametersChanged(String dialogID, String changedProp, Object newVal)
          Callback for when the bus instructs some parameters have changed.
 void addDialog(UIRequest oe)
          Callback for incoming dialogs.
 void closeCurrentDialog()
          Disposes of current dialog, and tries to load next.
 Resource cutDialog(String dialogID)
          Callback for Handler.cutDialog(String).
 void flush()
          to be called when the handler finishes.
 Collection getAllDialogs()
          Consult all the added dialogs that are not closed yet.
 UIRequest getCurrentDialog()
          get the Dialog Being currently displayed.
 Form getParentOf(String formURI)
          get the parent Form of a given formURI.
 void missingInput(Input input)
          This method is called when a Submit has detected there is a missing input it needs, therefore the model for that input should be notified (so the user knows).
 void setRenderer(Renderer renderer)
          Associate a Renderer to the FormManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUEUE_MAX

public static final int QUEUE_MAX
Maximum # dialogs to be queued

See Also:
Constant Field Values
Constructor Detail

QueuedFormManager

public QueuedFormManager()
Default constructor.

Method Detail

addDialog

public void addDialog(UIRequest oe)
Callback for incoming dialogs. This method will model and render (if necessary) the Form.

Specified by:
addDialog in interface FormManager
Parameters:
oe - UIRequest that includes the dialog to show

getCurrentDialog

public UIRequest getCurrentDialog()
get the Dialog Being currently displayed.

Specified by:
getCurrentDialog in interface FormManager
Returns:
the UIRequest currently being displayed

flush

public void flush()
to be called when the handler finishes. it should close all dialogs, and pending dialogs.

Specified by:
flush in interface FormManager

closeCurrentDialog

public void closeCurrentDialog()
Disposes of current dialog, and tries to load next.

Specified by:
closeCurrentDialog in interface FormManager

cutDialog

public Resource cutDialog(String dialogID)
Callback for Handler.cutDialog(String).

Specified by:
cutDialog in interface FormManager
Parameters:
dialogID - DialogURI to cut
Returns:
result of the operation

getParentOf

public Form getParentOf(String formURI)
get the parent Form of a given formURI.

Specified by:
getParentOf in interface FormManager
Parameters:
formURI - the URI of the child Form
Returns:
the parent of the child Form

setRenderer

public void setRenderer(Renderer renderer)
Description copied from interface: FormManager
Associate a Renderer to the FormManager.

Specified by:
setRenderer in interface FormManager
Parameters:
renderer - the Renderer to associate with

getAllDialogs

public Collection getAllDialogs()
Description copied from interface: FormManager
Consult all the added dialogs that are not closed yet.

Specified by:
getAllDialogs in interface FormManager
Returns:
a Collection of UIRequests

missingInput

public void missingInput(Input input)
Description copied from interface: FormManager
This method is called when a Submit has detected there is a missing input it needs, therefore the model for that input should be notified (so the user knows).

Specified by:
missingInput in interface FormManager

adaptationParametersChanged

public void adaptationParametersChanged(String dialogID,
                                        String changedProp,
                                        Object newVal)
Description copied from interface: FormManager
Callback for when the bus instructs some parameters have changed. Default behavior should be to re-render the form.

Specified by:
adaptationParametersChanged in interface FormManager


Copyright © 2014 universAAL Consortium. All Rights Reserved.