Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
jvx:firstapp [2020/06/08 12:26]
cduncan
jvx:firstapp [2021/03/22 14:09] (current)
admin
Line 7: Line 7:
 Before you start, you will need the following libraries and tools: Before you start, you will need the following libraries and tools:
  
-  * [[http://​sourceforge.net/​projects/​jvx/​files/​latest/​download|JVx Binary ​package]] +  * [[http://​sourceforge.net/​projects/​jvx/​files/​latest/​download|JVx Binary ​Package]] 
-  * Eclipse IDE (>= 3.4) with JDT (recommended:​ Eclipse IDE for Java EE developers)+  * Eclipse IDE (>= 3.4) with JDT (recommended:​ Eclipse IDE for Java EE Developers)
   * JDK 6.0 (1.6) or higher   * JDK 6.0 (1.6) or higher
   * HSQLDB library (http://​www.hsqldb.org)   * HSQLDB library (http://​www.hsqldb.org)
-  * [[http://​sourceforge.net/​projects/​jvxfirstapp/​files/​latest/​download|JVx ​sample ​Eclipse ​project]]+  ​* [[https://​search.maven.org/​artifact/​org.swinglabs.swingx/​swingx-all/​1.6.4/​jar|SwingX]] lib 
 +  ​* [[http://​sourceforge.net/​projects/​jvxfirstapp/​files/​latest/​download|JVx ​Sample ​Eclipse ​Project]]
  
 For our JVx sample application,​ we need the following parts: For our JVx sample application,​ we need the following parts:
  
   * [[#​application|Application]]   * [[#​application|Application]]
-  * [[#​workscreen|Work screen]] +  * [[#​workscreen|Workscreen]] 
-  * [[#​workscreen|Business ​object]] +  * [[#​workscreen|Business ​Object]] 
-  * [[#​database|Database ​connection]]+  * [[#​database|Database ​Connection]]
  
 {{anchor:​application:​}} {{anchor:​application:​}}
Line 51: Line 52:
  
   /**   /**
-   * Creates a new instance of <​code>​FirstApplication</​code>​ with a technology+   * Creates a new instance of <​code>​FirstApplication</​code>​ with a technology-
    * dependent launcher.    * dependent launcher.
    * <p/>    * <p/>
Line 62: Line 63:
   ​   ​
   //​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   //​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  // Overwritten ​methods+  // Overwritten ​Methods
   //​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   //​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
Line 140: Line 141:
  
 ^ Method ^ Description ^ ^ Method ^ Description ^
-|Constructor|A specific constructor is needed, as each application is started with a  launcher ​which depends on the technology used. This launcher is passed over to the application in the constructor.|+|Constructor|A specific constructor is needed, as each application is started with a  launcher ​that depends on the technology used. This launcher is passed over to the application in the constructor.|
 |createConnection|The communication protocol is initialized. A ''​DirectServerConnection''​ is sufficient for our application,​ as both the client and the server are started in the same VM. However, if an application server is integrated, a ''​HttpConnection''​ could also be used.| |createConnection|The communication protocol is initialized. A ''​DirectServerConnection''​ is sufficient for our application,​ as both the client and the server are started in the same VM. However, if an application server is integrated, a ''​HttpConnection''​ could also be used.|
 |getApplicationName|Sets the application name. This name is needed for the communication with the server, as the latter uses the appropriate application configuration depending on the application name. In our case, the application name must be "​firstapp",​ as the working directory is also called ''​../​JVxFirstApp/​rad/​**firstapp**/''​.| |getApplicationName|Sets the application name. This name is needed for the communication with the server, as the latter uses the appropriate application configuration depending on the application name. In our case, the application name must be "​firstapp",​ as the working directory is also called ''​../​JVxFirstApp/​rad/​**firstapp**/''​.|
 |afterLogin|This method is called by the super class after a successful login. We use this method to extend our menu and our toolbar.\\ \\ It is not necessary to reset the changes after logout, as this is done automatically by the super class.| |afterLogin|This method is called by the super class after a successful login. We use this method to extend our menu and our toolbar.\\ \\ It is not necessary to reset the changes after logout, as this is done automatically by the super class.|
-|createMenuItem|Provided by the super class to create menu entries. The first parameter contains the name of the method which is to be called when the menu entry is selected. The second parameter contains the command (ActionCommand),​ which plays no role in our case. The text of the menu entry is to be defined in the third parameter, and lastly, the image for the entry is passed over.|+|createMenuItem|Provided by the super class to create menu entries. The first parameter contains the name of the method which is to be called when the menu entry is selected. The second parameter contains the command (ActionCommand),​ which plays no role in our case. The text of the menu entry is to be defined in the third parameter, andlastly, the image for the entry is passed over.|
 |createToolBarButton|Similar to ''​createMenuItem'',​ except that this method creates a button which adapts to the layout of the toolbar.| |createToolBarButton|Similar to ''​createMenuItem'',​ except that this method creates a button which adapts to the layout of the toolbar.|
 |UIImage.getImage|Provides a predefined image from the JVx image library. \\ For ease of use, we use a predefined image.| |UIImage.getImage|Provides a predefined image from the JVx image library. \\ For ease of use, we use a predefined image.|
Line 263: Line 264:
 ^ Method ^ Description ^ ^ Method ^ Description ^
 |initializeModel|Initialises the client objects for the access to the server or the data.| |initializeModel|Initialises the client objects for the access to the server or the data.|
-|InitializeUI|Layouting ​of the work screen.| +|InitializeUI|Laying out of the workscreen.| 
-|createSubConnection|We create a separate connection to the server. This has the advantage that a separate business object is used on the server. This object contains all objects needed by the work screen. Once the work screen is closed, the used memory is released. Moreover, each connection can have special parameters and time outs. \\ The requested business object is defined with the following class: ''​apps.firstapp.frames.DBEdit''​. \\ \\ The class will be created later on.|+|createSubConnection|We create a separate connection to the server. This has the advantage that a separate business object is used on the server. This object contains all objects needed by the workscreen. Once the work screen is closed, the used memory is released. Moreover, each connection can have special parameters and timeouts. \\ The requested business object is defined with the following class: ''​apps.firstapp.frames.DBEdit''​. \\ \\ The class will be created later on.|
  
 ^ Member ^ Description ^ ^ Member ^ Description ^
-|connection|The connection to the serverspecially ​ for the work screen. A special communication protocol is used in the background. In our case, it mirrors the ''​DirectServerConnection''​ class.|+|connection|The connection to the server specially ​ for the workscreen. A special communication protocol is used in the background. In our case, it mirrors the ''​DirectServerConnection''​ class.|
 |dataSource|This is the data source and looks after the transfer of data between the client and the server. The connection is used for the transfer.| |dataSource|This is the data source and looks after the transfer of data between the client and the server. The connection is used for the transfer.|
 |rdbContacts|The model and the controller for data display. \\ The name contacts defines under which name the server-side business object can be found.| |rdbContacts|The model and the controller for data display. \\ The name contacts defines under which name the server-side business object can be found.|
  
 {{anchor:​business:​}} {{anchor:​business:​}}
-== Create a business object ​==+== Create a Business Object ​==
  
-Once we have created the client, we need the corresponding business object on the serverso as to define the source of the data more precisely. To do so, we use the following code:+Once we have created the client, we need the corresponding business object on the server so as to define the source of the data more precisely. To do so, we use the following code:
  
 <file java DBEdit.java>​ <file java DBEdit.java>​
Line 324: Line 325:
  
 ^ Description ^ ^ Description ^
-|The class mirrors the business object for the ''​DBEditFrame'' ​work screen. The objects can only be accessed via the SubConnection of the work screen. \\ Through the class derivation of ''​apps.firstapp.Session'',​ it is very easy to access all objects of the Session ​and the ''​Application''​.|+|The class mirrors the business object for the ''​DBEditFrame'' ​workscreen. The objects can only be accessed via the SubConnection of the workscreen. \\ Through the class derivation of ''​apps.firstapp.Session'',​ it is very easy to access all objects of the session ​and the ''​Application''​.|
  
 ^ Method ^ Description ^ ^ Method ^ Description ^
-|getContacts|Enables the access to the database ​tablee ​''​CONTACTS''​. The method name must match the object name of the RemoteDataBook:​ ''​contacts => getContacts''​. \\ \\ Exception handling is taken over by the server.|+|getContacts|Enables the access to the database ​table ''​CONTACTS''​. The method name must match the object name of the RemoteDataBook:​ ''​contacts => getContacts''​. \\ \\ Exception handling is taken over by the server.|
  
 {{anchor:​database:​}} {{anchor:​database:​}}
-== Create a database connection ​==+== Create a Database Connection ​==
  
-In the business object, we referred to the data source with the method ''​getDBAccess()''​. In our case we use a HyperSQL database. We define the database connection in the following class:+In the business object, we referred to the data source with the method ''​getDBAccess()''​. In our casewe use a HyperSQL database. We define the database connection in the following class:
  
 <file java Session.java>​ <file java Session.java>​
Line 380: Line 381:
  
 ^ Method ^ Description ^ ^ Method ^ Description ^
-|getDBAccess|Opens a new connection to a HSQL databaseif this has not yet occurred. \\ \\ Exception handling is taken on by the server.|+|getDBAccess|Opens a new connection to a HSQL database if this has not yet occurred. \\ \\ Exception handling is taken on by the server.|
 \\  \\ 
-The application is now fully implemented and ready to run. To be able to work with the application we need the database including the ''​CONTACTS''​ table which we want to access. It has already been created in the Eclipse project and can be started with ''​../​JVxFirstApp/​db/​startHSqlDB.bat''​.+The application is now fully implemented and ready to run. To be able to work with the applicationwe need the database including the ''​CONTACTS''​ tablewhich we want to access. It has already been created in the Eclipse project and can be started with ''​../​JVxFirstApp/​db/​startHSqlDB.bat''​.
  
-== The first JVx application ​==+== The First JVx Application ​==
  
-Once the database has been started, the application can be started via the Run menu in Eclipse. The finished application should now look as follows:+Once the database has been started, the application can be started via the run menu in Eclipse. The finished application should now look as follows:
  
 {{:​jvx:​app_finished.png?​nolink|}} {{:​jvx:​app_finished.png?​nolink|}}
  
-You can find more details about the components of a JVx application as well as step by step instructions for Eclipse under [[jvx:​firstapp_step-by-step|Step by step introductions to the JVx application]].+You can find more details about the components of a JVx application as well as step-by-step instructions for Eclipse under [[jvx:​firstapp_step-by-step|Step by step introductions to the JVx application]].
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information