|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.ui.UserInterface
Pluggable user interface abstraction A user interface defines all the interactions between the user and the program; they are grouped by categories as follows:
RulingInterface
groups the interactions concerning the program ruling, i.e. command-line parsingRunningInterface
groups the output made by the program concerning its running (progress reports etc.)ErrorInterface
groups the interactions made in case of errors, which may lead the program either to terminate
or to ignore them.LogInterface
defines the log level and where to output log eventsBy now three different user interfaces are proposed:
sam.ui.basic.UserInterface
is a basic non-interactive user interfacesam.ui.text.UserInterface
is a simple text-based user interfacesam.ui.awt.UserInterface
is a simple awt
based graphical user interface
RulingInterface
,
RunningInterface
,
ErrorInterface
,
LogInterface
Nested Class Summary | |
static class |
UserInterface.Abort
Exception thrown whenever the whole program should abort. |
Field Summary | |
static sam.toolkit.ClassRegistry |
REGISTRY
Class registry in charge of registring and lazily instantiating UserInterface s |
Constructor Summary | |
protected |
UserInterface()
|
Method Summary | |
static void |
disposeFrames()
Abruptly disposes all frames of the application. |
abstract sam.ui.ErrorInterface |
error()
|
static sam.ui.UserInterface |
get()
Gets the current user interface. |
static java.lang.String[] |
getKnwonInterfaces()
Gets the list of all known user interfaces |
static boolean |
isSet()
Wether a user interface has ever been set. |
abstract sam.ui.LogInterface |
log()
|
static void |
main(java.lang.String[] arguments)
Simple test code Loads a user interface and performs basic tests on it Syntax is java sam.ui.UserInterface [user-interface] |
protected static boolean |
register(java.lang.Class UI,
java.lang.String name)
Registers a new UserInterface as name
|
abstract sam.ui.RulingInterface |
ruling()
|
abstract sam.ui.RunningInterface |
running()
|
static boolean |
set(java.lang.String name)
Sets name as the current user interface. |
protected static void |
setBest()
Sets the best user interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final sam.toolkit.ClassRegistry REGISTRY
UserInterface
s
Constructor Detail |
protected UserInterface()
Method Detail |
public static boolean set(java.lang.String name)
name
as the current user interface.
NoSuchElementException
- if name
is not a registered UserInterface
public static boolean isSet()
set(java.lang.String)
protected static void setBest()
Settings.Constants.UI.PREFERENCES
,
Settings.Constants.UI.FAILSAFE
public static java.lang.String[] getKnwonInterfaces()
protected static boolean register(java.lang.Class UI, java.lang.String name)
UserInterface
as name
This is also set as the current one if none currently is.
public static sam.ui.UserInterface get()
Instanciation is lazy and occurs only once.
public static void disposeFrames()
public abstract sam.ui.RulingInterface ruling()
RulingInterface
associated with this UserInterface
public abstract sam.ui.RunningInterface running()
RunningInterface
associated with this UserInterface
public abstract sam.ui.ErrorInterface error()
ErrorInterface
associated with this UserInterface
public abstract sam.ui.LogInterface log()
LogInterface
associated with this UserInterface
public static void main(java.lang.String[] arguments)
java sam.ui.UserInterface [user-interface]
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |