Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)

com.lapetus_ltd.api
Class TLptsMainDatabase

java.lang.Object
  extended by com.lapetus_ltd.api.TLptsMainDatabase

public class TLptsMainDatabase
extends java.lang.Object

Class Description : This is the main module for dbJAPI, and it is responsible for initialising the system.
The init() function needs to be called at the beginning of every application that uses dbJAPI.


$LastChangedRevision: 1198 $
$LastChangedDate:: 2010-11-23 09:48:06#$


Method Summary
static void cursorNormal()
          Shows a normal cursor if the main application frame has been set.
static void cursorWait()
          Shows a wait cursor if the main application frame has been set.
static javax.swing.JFrame getApplicationMainFrame()
          Gets the main application frame set by setApplicationMainFrame(javax.swing.JFrame).
static void init()
          Initiates all the static modules of dbJAPI.
static void init(java.lang.String appPath)
          Initiates all the static modules of dbJAPI.
static void setApplicationMainFrame(javax.swing.JFrame frame)
          Sets the application main frame to be used for cursor changing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cursorNormal

public static void cursorNormal()
Shows a normal cursor if the main application frame has been set.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :
To be used after setApplicationMainFrame(javax.swing.JFrame).
This is also used internally by the dbJAPI dialogs to indicate the end of a wait period.

Example :

 static public void main(String[] args)
 {
   TLptsMainDatabase.init();
   .. // init application data
   TLptsMainDatabase.setApplicationMainFrame(new MyDbJAPIApplicationFrame());
 }
 private class MyDbJAPIApplicationFrame
 {
   private MyDbJAPIApplicationFrame()
   {
   }
   public void myGreatFunction()
   {
     TLptsMainDatabase.cursorWait();
     // ... do all the magic stuff while the user waits
     TLptsMainDatabase.cursorNormal();
   }
 }
 


cursorWait

public static void cursorWait()
Shows a wait cursor if the main application frame has been set.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :
To be used after setApplicationMainFrame(javax.swing.JFrame).
This is also used internally by the dbJAPI dialogs to indicate a wait period.

Example :

 static public void main(String[] args)
 {
   TLptsMainDatabase.init();
   .. // init application data
   TLptsMainDatabase.setApplicationMainFrame(new MyDbJAPIApplicationFrame());
 }
 private class MyDbJAPIApplicationFrame
 {
   private MyDbJAPIApplicationFrame()
   {
   }
   public void myGreatFunction()
   {
     TLptsMainDatabase.cursorWait();
     // ... do all the stuff while the user waits
     TLptsMainDatabase.cursorNormal();
   }
 }
 


getApplicationMainFrame

public static javax.swing.JFrame getApplicationMainFrame()
Gets the main application frame set by setApplicationMainFrame(javax.swing.JFrame).

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :

Returns:
The frame set by setApplicationMainFrame or null.

init

public static void init()
Initiates all the static modules of dbJAPI.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes : This is required at the beginning of every dbJAPI application.

Example :

 static public void main(String[] args)
 {
   TLptsMainDatabase.init();
   ...
 }
 


init

public static void init(java.lang.String appPath)
Initiates all the static modules of dbJAPI.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes : This is required before using dbJAPI code in your application

Example :

 static public void main(String[] args)
 {
   TLptsMainDatabase.init(appPath);
   ...
 }
 

Parameters:
appPath - path to the application or plugin.

setApplicationMainFrame

public static void setApplicationMainFrame(javax.swing.JFrame frame)
Sets the application main frame to be used for cursor changing.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :
Use this to set the main frame so that the cursor can go from WAIT for NORMAL state, or visa-versa,
when required by the system as an indication to the user.

Example :

 static public void main(String[] args)
 {
   TLptsMainDatabase.init();
   .. // init application data
   TLptsMainDatabase.setApplicationMainFrame(new MyDbJAPIApplicationFrame());
 }
 

Parameters:
frame - The frame to set as the main application frame.


Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)