org.opensubsystems.core.application
Interface ThickClientGui

All Known Implementing Classes:
SWTThickClientGui

public interface ThickClientGui

Interface specifying methods that needs to be implemented by specific gui technology such as SWT or AWT for the thick client to function.

Version:
$Id: ThickClientGui.java,v 1.6 2007/01/07 06:14:39 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
1.4 2006/02/04 04:48:52 bastafidli

Field Summary
static int GUI_ANYWHERE
          The GUI can be displayed anywhere on the screen.
static int GUI_FULLSCREEN
          Display the GUI stretched to the whole screen (the default behavior).
static int GUI_LEFTSCREEN
          Display the GUI on the left screen (or left half of the whole screen).
static int GUI_RIGHTSCREEN
          Display the GUI on the right screen (or right half of the whole screen).
static java.lang.String MESSAGE_ANSWER_YES
          Answer for the MESSAGE_STYLE_YES_NO_QUESTION dialog
static java.lang.String MESSAGE_STYLE_ERROR
          Flags required to display error message.
static java.lang.String MESSAGE_STYLE_INFO
          Flags required to display information message.
static java.lang.String MESSAGE_STYLE_YES_NO_QUESTION
          Flags required to display message with yes/no question.
static java.lang.String MESSAGE_TITLE_ERROR
          Title to use for question messages.
static java.lang.String MESSAGE_TITLE_INFO
          Title to use for information messages.
static java.lang.String MESSAGE_TITLE_QUESTION
          Title to use for question messages.
 
Method Summary
 void activateModule(ThickClientModule module)
          Activate specified module so that it is available for user interaction.
 void createClientArea()
          Create client area of the application.
 void createDisplayResources(boolean bHideCursor)
          Initialize any resources which are required by gui.
 void createMainWindow()
          Create the main window of the application with all the default elements, such as toolbar and main client area.
 void createModules(java.util.Map mapModules)
          Create graphical representation of specified modules
 void destroyClientArea()
          Release and destroy resources allocated for the client area.
 void destroyDisplayResources()
          Release resources allocated by GUI.
 void destroyMainWindow()
          Destroy all resources allocated when main window was created.
 void destroyModules(java.util.Map mapModules)
          Destroy graphical representation of specified modules
 void displayMainWindow(int iScreenPosition, boolean bFixedSize)
          Display the main application window.
 java.lang.Object displayMessage(java.lang.String strTitle, java.lang.String strMessage, java.lang.Object additionalInfo)
          Display message to user.
 java.lang.String getGuiTechnology()
          Return String identifier for the GUI technology used by the instance of thick client.
 void init(ThickClient client)
          Initialize the gui for a give client
 void interactWithUser()
          Main message loop which processes messages for the application caused by user actions such as typing or mouse clicks.
 void pasivateModule(ThickClientModule module)
          Pasivate the specified module so that it is not available for user interaction anymore.
 

Field Detail

GUI_FULLSCREEN

static final int GUI_FULLSCREEN
Display the GUI stretched to the whole screen (the default behavior).

See Also:
Constant Field Values

GUI_LEFTSCREEN

static final int GUI_LEFTSCREEN
Display the GUI on the left screen (or left half of the whole screen).

See Also:
Constant Field Values

GUI_RIGHTSCREEN

static final int GUI_RIGHTSCREEN
Display the GUI on the right screen (or right half of the whole screen).

See Also:
Constant Field Values

GUI_ANYWHERE

static final int GUI_ANYWHERE
The GUI can be displayed anywhere on the screen.

See Also:
Constant Field Values

MESSAGE_STYLE_YES_NO_QUESTION

static final java.lang.String MESSAGE_STYLE_YES_NO_QUESTION
Flags required to display message with yes/no question.

See Also:
Constant Field Values

MESSAGE_STYLE_ERROR

static final java.lang.String MESSAGE_STYLE_ERROR
Flags required to display error message.

See Also:
Constant Field Values

MESSAGE_STYLE_INFO

static final java.lang.String MESSAGE_STYLE_INFO
Flags required to display information message.

See Also:
Constant Field Values

MESSAGE_ANSWER_YES

static final java.lang.String MESSAGE_ANSWER_YES
Answer for the MESSAGE_STYLE_YES_NO_QUESTION dialog

See Also:
Constant Field Values

MESSAGE_TITLE_QUESTION

static final java.lang.String MESSAGE_TITLE_QUESTION
Title to use for question messages.

See Also:
Constant Field Values

MESSAGE_TITLE_ERROR

static final java.lang.String MESSAGE_TITLE_ERROR
Title to use for question messages.

See Also:
Constant Field Values

MESSAGE_TITLE_INFO

static final java.lang.String MESSAGE_TITLE_INFO
Title to use for information messages.

See Also:
Constant Field Values
Method Detail

init

void init(ThickClient client)
Initialize the gui for a give client

Parameters:
client - - client to initialize the gui for

createDisplayResources

void createDisplayResources(boolean bHideCursor)
Initialize any resources which are required by gui. These resources are usually required to be created only once and then can be reused over and over. This method doesn't do any cleanup in case of problems. Regardless if this method suceeds or fails, caller is responsible for calling destroyDisplayResources in finally clause.

Parameters:
bHideCursor - - hide cursor since it might be distracting

destroyDisplayResources

void destroyDisplayResources()
Release resources allocated by GUI. This releases resources allocated in createDisplayResources and any global resources.


createMainWindow

void createMainWindow()
Create the main window of the application with all the default elements, such as toolbar and main client area.


destroyMainWindow

void destroyMainWindow()
Destroy all resources allocated when main window was created. This must be called in finally clause of try block where createMainWindow was called.


createClientArea

void createClientArea()
Create client area of the application.


destroyClientArea

void destroyClientArea()
Release and destroy resources allocated for the client area. This must be called in finally clause of try block where createMainArea was called.


displayMainWindow

void displayMainWindow(int iScreenPosition,
                       boolean bFixedSize)
Display the main application window. This method should be called when the application is ready to be displayed on the screen and interact with the user.

Parameters:
iScreenPosition - - screen position where to display the gui
bFixedSize - - should the gui be fixed size

interactWithUser

void interactWithUser()
Main message loop which processes messages for the application caused by user actions such as typing or mouse clicks.


getGuiTechnology

java.lang.String getGuiTechnology()
Return String identifier for the GUI technology used by the instance of thick client.

Returns:
String - name of the GUI technology used for the thick client

displayMessage

java.lang.Object displayMessage(java.lang.String strTitle,
                                java.lang.String strMessage,
                                java.lang.Object additionalInfo)
Display message to user.

Parameters:
strTitle - - title of the message, look at constants in this interface
strMessage - - message to display
additionalInfo - - additional information to pass in, this may be implementation specific, look at constants in this interface
Returns:
Object - result of the message, this may be implementation specific

createModules

void createModules(java.util.Map mapModules)
                   throws OSSException
Create graphical representation of specified modules

Parameters:
mapModules - - key is module identification and value is the module itself (ThickClientModule).
Throws:
OSSException - - an error has occured

destroyModules

void destroyModules(java.util.Map mapModules)
Destroy graphical representation of specified modules

Parameters:
mapModules - - key is module identification and value is the module itself (ThickClientModule).

pasivateModule

void pasivateModule(ThickClientModule module)
Pasivate the specified module so that it is not available for user interaction anymore.

Parameters:
module - - module to pasivate

activateModule

void activateModule(ThickClientModule module)
Activate specified module so that it is available for user interaction.

Parameters:
module - - module to activate


Copyright © 2003 - 2006 OpenSubsystems s.r.o.