|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.coderight.jazz.Controller
nl.coderight.jazz.Application
public abstract class Application
Application is the root Controller of the Hierarchical Model-View-Controller (HMVC) layers.
The HMVC pattern decomposes an application into a hierarchy of parent-child MVC layers. For more information about HMVC article MyApp +- MyAppView +- MyAppModel | +- MyController_1 | +- MyView_1 | +- MyModel_1 | | | +- MyController_1_1 | | +- MyView_1_1 | | +- MyModel_1_1 | | | +- etc. | +- etc.
Example:
public class MyApp extends Application {
private MyAppModel myModel;
private MyAppView myView;
public void execute() {
myModel = new MyAppModel();
myView = new MyAppView();
setModel(myModel);
setView(myView);
showView();
}
public void init() {
setCrossPlatformLookAndFeel();
}
public static void main(String[] args) {
new MyApp().start();
}
Default event-handlers:
Default the following settings are used:
Model,
View,
Controller| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class nl.coderight.jazz.Controller |
|---|
Controller.EventNotHandledException |
| Constructor Summary | |
|---|---|
Application()
Constructor (default WindowMode.SINGLE_WINDOW). |
|
Application(ViewManager.WindowMode windowMode)
Constructor for custom WindowMode. |
|
Application(ViewManager.WindowMode windowMode,
ViewManager.ScreenMode fullscreen)
Constructor for custom WindowMode and ScreenMode. |
|
| Method Summary | |
|---|---|
void |
exit()
Exit application. |
String |
getApplicationName()
Returns application name (from JazzLicense). |
String |
getApplicationVersion()
Return application version (from AppLauncher). |
List<Module> |
getInstalledModules()
Returns a list of installed modules. |
String |
getSystemInfo()
|
void |
handleEvent(ApplicationEvent evt)
|
void |
handleEvent(MessageEvent evt)
Default handling of MessageEvent. |
void |
handleEvent(ProgressEvent evt)
Default handling of ProgressEvent. |
void |
handleEvent(ViewEvent evt)
Default handling of ViewEvent. |
void |
hide()
Hides the application window. |
void |
hideSplashScreen()
Hides the SplashScreen. |
abstract void |
init()
Invoked when application is started. |
void |
installModule(Module module)
Installs a Module. |
static void |
main(String[] args)
|
protected void |
onEventNotHandled(Event event)
Invoked when an event is not handled. |
protected void |
onExit()
Invoked when the application exits. |
protected void |
onIdle()
Invoked when idle time is set. |
protected void |
onStart()
Invoked when the application starts. |
void |
setCrossPlatformLookAndFeel()
Sets cross-platform look and feel. |
void |
setIdleTime(int time)
Sets idle time in milliseconds. |
void |
setLookAndFeel(LookAndFeel laf)
Sets custom look and feel. |
void |
setLookAndFeel(String laf)
Sets custom look and feel. |
void |
setNimbusLookAndFeel()
Sets Nimbus look and feel. |
void |
setResourceManager(ResourceManager resourceManager)
Sets the ResourceManager. |
void |
setSplashScreen(SplashScreen splashScreen)
Sets application SplashScreen. |
void |
setSystemLookAndFeel()
Sets system look and feel. |
void |
setSystemTrayIcon(SystemTrayIcon systemTrayIcon)
Sets the SystemTrayIcon. |
void |
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Sets the UncaughtExceptionHandler. |
void |
show()
Shows the application window. |
void |
showMessage(String message,
MessageEvent.MessageEventType messageEventType)
Displays an alert dialog. |
void |
showSplashScreen()
Shows the SplashScreen. |
void |
start()
Start application on the Event Dispatch Thread. |
| Methods inherited from class nl.coderight.jazz.Controller |
|---|
closeView, execute, executeController, executeTask, getApplication, getModel, getView, handleEvent, onAfterShowView, onBeforeShowView, propagateEvent, setModel, setView, showView, showView |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Application()
public Application(ViewManager.WindowMode windowMode)
WindowMode.
public Application(ViewManager.WindowMode windowMode,
ViewManager.ScreenMode fullscreen)
WindowMode and ScreenMode.
| Method Detail |
|---|
public final String getApplicationName()
public String getApplicationVersion()
public final void start()
Invokes the following sequence of methods:
public abstract void init()
Use this for example to open a (database) connection, set the look and feel and configure the application.
start()public void show()
hide()public void hide()
Use this for example with SystemTrayIcon to run the application in the background.
show()public final void exit()
onExit()public final void installModule(Module module)
Module.
public final List<Module> getInstalledModules()
public final void setSplashScreen(SplashScreen splashScreen)
SplashScreen.
The splash screen is displayed when the application starts and closed when the first view becomes visible (if auto close true).
public void showSplashScreen()
SplashScreen.
setSplashScreen(SplashScreen)public void hideSplashScreen()
SplashScreen.
setSplashScreen(SplashScreen)public final void setSystemLookAndFeel()
public final void setCrossPlatformLookAndFeel()
public final void setNimbusLookAndFeel()
public final void setLookAndFeel(String laf)
public final void setLookAndFeel(LookAndFeel laf)
public final void setResourceManager(ResourceManager resourceManager)
ResourceManager.
public final void setSystemTrayIcon(SystemTrayIcon systemTrayIcon)
SystemTrayIcon.
public final void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
UncaughtExceptionHandler.
public void showMessage(String message,
MessageEvent.MessageEventType messageEventType)
public final void handleEvent(ApplicationEvent evt)
public final void handleEvent(ViewEvent evt)
ControllerViewEvent.
OPEN: change the mouse cursor shape toCursor.WAIT_CURSORSHOW: change the mouse cursor shape toCursor.DEFAULT_CURSOR
handleEvent in class Controllerpublic void handleEvent(MessageEvent evt)
MessageEvent.
MessageEventType.PLAIN is shown as an alert dialog.
handleEvent in class ControllerController.handleEvent(MessageEvent)public void handleEvent(ProgressEvent evt)
ProgressEvent.
START -> change the mouse cursor shape toCursor.WAIT_CURSORSTOP -> change the mouse cursor shape toCursor.DEFAULT_CURSOR
handleEvent in class ControllerController.handleEvent(ProgressEvent),
ProgressMonitorpublic final void setIdleTime(int time)
Use this for example to logout a user after a given time of inactivity.
time - in milliseconds to wait before the onIdle method is calledonIdle()protected void onIdle()
setIdleTime(int)protected void onStart()
Use this for example to open a database.
start()protected void onExit()
use this for example to close a database.
exit()protected void onEventNotHandled(Event event)
NOTE! default implementation shows a message dialog. You should override this method for example to write not handled events to a log file.
onEventNotHandled in class Controllerpublic final String getSystemInfo()
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||