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
-
acquire()
- Acquire the current display.
-
confirm(Document, String)
- Present a document that has to be confirmed by the user
-
confirmMessage(String, String)
- Ask the user for a confirmation on a simple message
-
evalForm(Document, Vector)
- Present a document and a form.
-
formMessage(String, String, String, Vector)
- Present a simple message and a form.
-
getName()
- Get the name for the session
-
redraw()
- Redraw the TinguinDisplay, e g., if it was resized
-
release()
- Release the current display.
-
selectObject(Document, Vector)
- Present a option list dialog.
-
setName(String)
- Set the name for the session
-
setStatusLine(String)
- Set the status line.
-
showDocument(Document)
- Present a Document..
-
yesNoDialog(Document, String, String)
- Present a yes-no-dialog.
-
yesNoMessage(String, String, String)
- Present a simple message and ask the user a simple yes no dialog.
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.
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
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
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
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
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
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
showDocument
public abstract void showDocument(Document d)
- Present a Document..
setStatusLine
public abstract void setStatusLine(String d)
- Set the status line.
- Parameters:
- d - The status line string.
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
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
setName
public abstract void setName(String name)
- Set the name for the session
- Parameters:
- name - The name
getName
public abstract String getName()
- Get the name for the session
redraw
public abstract void redraw()
- Redraw the TinguinDisplay, e g., if it was resized
All Packages Class Hierarchy This Package Previous Next Index