Interface semper.tinguin.TinguinDisplay
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface semper.tinguin.TinguinDisplay

public interface TinguinDisplay
extends Object
Interface for TINGUIN's. This interface specifies the basic functionality of a user interface for Semper, such as open or close a display, present a document or show a document with dialog.
Version:
0.6
Author:
Tobias Himstedt
See Also:
Document

Method Index

 o acquire()
Acquire the current display.
 o confirm(Document, String)
Present a document that has to be confirmed by the user
 o confirmMessage(String, String)
Ask the user for a confirmation on a simple message
 o evalForm(Document, Vector)
Present a document and a form.
 o formMessage(String, String, String, Vector)
Present a simple message and a form.
 o getName()
Get the name for the session
 o redraw()
Redraw the TinguinDisplay, e g., if it was resized
 o release()
Release the current display.
 o selectObject(Document, Vector)
Present a option list dialog.
 o setName(String)
Set the name for the session
 o setStatusLine(String)
Set the status line.
 o showDocument(Document)
Present a Document..
 o yesNoDialog(Document, String, String)
Present a yes-no-dialog.
 o yesNoMessage(String, String, String)
Present a simple message and ask the user a simple yes no dialog.

Methods

 o confirmMessage
  public abstract void confirmMessage(String m,
                                      String confirmLabel)
Ask the user for a confirmation on a simple message
Parameters:
m - The (multiline) message which is displayed.
confirmLabel - The String label in the confirmation button.
 o yesNoMessage
  public abstract boolean yesNoMessage(String m,
                                       String yesLabel,
                                       String noLabel)
Present a simple message and ask the user a simple yes no dialog.
Parameters:
m - The (multiline) message which is displayed.
yesLabel - The String label in the yes button.
noLabel - The String label in the no button.
Returns:
true if yes was selected, false otherwise
 o formMessage
  public abstract DialogResult formMessage(String m,
                                           String yesLabel,
                                           String noLabel,
                                           Vector fields)
Present a simple message and a form. The elements of the form are given in a vector. Example:

Vector f = new Vector();
f.add(new Entry("Firstname"));
f.add(new Entry("Lastname", true, true)); // Input is required but visible
f.add(new Entry("Password", false)); // Character echo is unvisible
DialogResult r = display.formMessage("Enter values", "OK", "Cancel", f);
// To retrieve wether ok/cancel was pressed
boolean status = r.ok();
Hashtable t = (Hashtable)r.result()

Parameters:
m - The (multiline) message which is displayed.
yesLabel - The String label in the yes button.
noLabel - The String label in the no button.
fields - A vector of entries that specfies the input fields, their labels and there properties such as character echo visibilty.
Returns:
A DialogResult object returned. The result method of this object returns a Hashtable with key/value pairs. The keys are the the elements for the variable fields. The values are the inputs from the user.
See Also:
result, Entry
 o yesNoDialog
  public abstract boolean yesNoDialog(Document d,
                                      String ok,
                                      String cancel)
Present a yes-no-dialog.
Parameters:
d - The document to be presented
ok - The label for the yes-button
cancel - The label for the no-button
Returns:
true if yes was selected, false otherwise
 o confirm
  public abstract void confirm(Document d,
                               String confirmLabel)
Present a document that has to be confirmed by the user
Parameters:
d - The document to be presented
confirmLabel - The label of the confirm button
 o evalForm
  public abstract DialogResult evalForm(Document d,
                                        Vector fields)
Present a document and a form. The elements of the form are given in a vector. Example:

Vector f = new Vector();
f.add(new Entry("Firstname"));
f.add(new Entry("Lastname", true, true)); // Input is required but visible
f.add(new Entry("Password", false)); // Character echo is unvisible
DialogResult r = display.evalForm(document, "OK", "Cancel", f);
// To retrieve wether ok/cancel was pressed
boolean status = r.ok();
Hashtable t = (Hashtable)r.result()

Parameters:
d - The document which is displayed.
fields - A vector of entries that specfies the input fields, their labels and there properties such as character echo visibilty.
Returns:
A DialogResult object returned. The result method of this object returns a Hashtable with key/value pairs. The keys are the the elements for the variable fields. The values are the inputs from the user.
See Also:
result, Entry
 o selectObject
  public abstract DialogResult selectObject(Document d,
                                            Vector list)
Present a option list dialog.
Parameters:
d - The document which is displayed.
list - A list of objects. For each object e int the list, e.toString will be is insertet in an option list. This option list is selectable by the user. The corresponding object of the selected string is then returned.
Returns:
A DialogResult object returned. The result method of this object returns an object from the vector list of objecs. This returned object was selected by the user.

Vector f = new Vector();
f.add(new UmbrellaObject());
f.add(new String("Hello"));
DialogResult r = display.evalForm(doc, "OK", "Cancel", f);
// To retrieve wether ok/cancel was pressed
boolean status = r.ok();
Object t = r.result()

See Also:
result
 o showDocument
  public abstract void showDocument(Document d)
Present a Document..
 o setStatusLine
  public abstract void setStatusLine(String d)
Set the status line.
Parameters:
d - The status line string.
 o acquire
  public abstract void acquire()
Acquire the current display. This should be done always and each time before something is shown with showDocument, evalForm, confirm or yesNoDialog. It is necessary in order to synchronize the access to a display when different managers want to present someting on the same display. Example

display.acquire();
display.confirm(document, "Confirmed");
display.release();

In case the display is already in use by another manager, acquire will wait until the display is released and then return.

See Also:
release, showDocument, evalForm
 o release
  public abstract void release()
Release the current display. If a manager has presented some contents it should immediately release the display so that other managers don't have to wait more than necessay.
See Also:
acquire, showDocument
 o setName
  public abstract void setName(String name)
Set the name for the session
Parameters:
name - The name
 o getName
  public abstract String getName()
Get the name for the session
 o redraw
  public abstract void redraw()
Redraw the TinguinDisplay, e g., if it was resized

All Packages  Class Hierarchy  This Package  Previous  Next  Index