|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fdda.utils.Notification
Provides an abstract interface for communicating messages to the user. The
way these messages are displayed depends on the dialog component, where a
subclass of Notification must be specified to do the real work. Each
message has a source (roughly spoken the subsystem that triggers it) and a
type.
Notification messages are not to be confused with logging; these are messages
that the user shall definitely see; in some cases these are even questions
the user must answer.
The 'message'-methods are all synchronized and it's therefore safe to use
them from several concurrent threads (though no order of showing the
messages is garanteed).
Field Summary | |
static int |
M_CONFIRM
Type 'confirmation' |
static int |
M_ERROR
Type 'error' |
static int |
M_QUESTION
Type 'question'. |
static int |
M_WARNING
Type 'warning'. |
static int |
S_ALGORITHM
Source 'Algorithm' |
static int |
S_MOD
Source 'Modelling' |
static int |
S_PLUGIN
Source 'Plug-in' |
static int |
S_PROCESSING
Source 'Processing' |
static int |
S_SYSTEM
Source 'Operating System' |
static int |
S_XML
Source 'XML-Processing' |
Constructor Summary | |
Notification()
|
Method Summary | |
static void |
indicateNormalState()
Indicates to the user that the application is not occupied (e.g. by changing the cursor). |
static void |
indicateOccupationState()
Indicates to the user that the application is occupied (e.g. by changing the cursor). |
protected abstract void |
indicateState(boolean occupation)
Delegate the occupation state indication to a subclass. |
static void |
message(int type,
int source,
String message)
Shows a message to the user, with a simple "Ok" button for confirmation and the source description as a title. |
static void |
message(int type,
int source,
String title,
String message)
Shows a message to the user, with a simple "Ok" button for confirmation. |
static int |
message(int type,
int source,
String message,
String[] buttons)
Shows a message to the user, with the source description as the title. |
static int |
message(int type,
int source,
String title,
String message,
String[] buttons)
Shows a message to the user. |
static void |
setNotification(Notification aNotification)
Initializes the component by specifying the subclass that shows the messages. |
static void |
setSourceName(int nr,
String name)
Sets the description / name for a certain source. |
protected abstract int |
showMessage(int type,
int source,
String title,
String message,
String[] buttons)
Delegate the showing of the message to a subclass. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int M_WARNING
public static final int M_QUESTION
public static final int M_CONFIRM
public static final int M_ERROR
public static final int S_XML
public static final int S_SYSTEM
public static final int S_ALGORITHM
public static final int S_MOD
public static final int S_PROCESSING
public static final int S_PLUGIN
Constructor Detail |
public Notification()
Method Detail |
public static final int message(int type, int source, String title, String message, String[] buttons)
type
- the type of the message, one of the constantssource
- the source of the message, probably one of the constantstitle
- the title of the message, e.g. used as title in a dialogmessage
- the message textbuttons
- the inscriptions for (abstract) buttons, e.g. {"yes", "no"}
public static final void message(int type, int source, String title, String message)
type
- the type of the message. It doesn't make sense to use this for
a questionsource
- the source of the message, probably one of the constantstitle
- the title of the message, e.g. used as title in a dialogmessage
- the message textpublic static final int message(int type, int source, String message, String[] buttons)
type
- the type of the message.source
- the source of the message, probably one of the constantsmessage
- the message textbuttons
- the inscriptions for (abstract) buttons, e.g. {"yes", "no"}
public static final void message(int type, int source, String message)
type
- the type of the message. It doesn't make sense to use this for
a questionsource
- the source of the message, probably one of the constantsmessage
- the message textpublic static final void indicateOccupationState()
public static final void indicateNormalState()
protected abstract int showMessage(int type, int source, String title, String message, String[] buttons)
type
- the type of the message, one of the constantssource
- the source of the message, probably one of the constantstitle
- the title of the message, e.g. used as title in a dialogmessage
- the message textbuttons
- the inscriptions for (abstract) buttons, e.g. {"yes", "no"}
protected abstract void indicateState(boolean occupation)
occupation
- whether the application is occupiedpublic static final void setNotification(Notification aNotification)
aNotification
- the (instance of) the subclass that shows the messagespublic static final void setSourceName(int nr, String name)
nr
- the number of the sourcename
- the name / description of the source
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |