Trying Out JGuiGen
[Previous] [Main] [Next]

Trying out JGuiGen


There are five ways to try out the JGuiGen.

1. Download the complete system using subversion from Sourceforge.net. We try very hard to keep the current trunk as a working system. This will have many features that are not in the last offical release. svn checkout https://svn.sourceforge.net/svnroot/jguigen/JGuiGen/trunk jguigen This will create a copy of the project in a jguigen folder one level deeper than the location where you ran svn. The screencasts on Sourceforge show exactly how to download, compile and run.

2. Download the system using Java Web start. This will not have the source code, but it does come with the HSQL database system and allows you to run the DataDictionary, create files, (compile from a command prompt or and IDE) and then run them from the JGuiGen main program. The main program has already been set up to show you a completed application screen and to run a screen called "JGuiGenDemo.class" that has already been created and a "UserLogData.class" that you can create. (This is not currently working, we are revising it.)

3.    Download the source code and class files and unzip them. I place mine in a JGuiGen folder on a drive other than C. On Linux I use \home\JGuiGen. You can place them whereever you want. JGuiGen Source code Vesion 1.0 The current source of the zip files is sf.net/projects/JGuiGen. A better source is to get the current version from sourceforge.net using subversion. This is docummented in the ReadMe.html file.

   By default, you will be using the HSQL database here. See the ReadMe.html for more information. This is a small self contained SQL database. By simply copying a jar file file and a couple of text files to your system you have a completely functions SQL database installed. It also comes with a small front end that lets you execute SQL commands directly on the database to create new tables, modify tables, view selected rows etc.

4.   You can download the source code and unzip it (from step 2). You can edit the JGuiGenIni.xml file and comment out the references to HSQL and uncomment the references to Postgres. This system will use a PostgreSQL database at halepringle.com. This option is subject to being closed without warning if there is abuse. I also do not guarantee that it will be up 24/7. We will be moving this to he sourceforge MySQL database soon.

5.   You can download the source code and unzip it (from step 1). The readme.html file contains instruction on putting the tables JGuiGen needs into your own database. JGuiGen comes with small java applications that will fill these table with data. The tables are 1) UserLogData - this is used by the use log in system, the query builder and as a demo of most of JGuiGens features. 2) JGuiGen_I18N - this contains the key=value pair information used to generate I18N resource bundles and data used by JGuiGen to create comboboxes, radiobuttons etc. in your applications and 3) data_dict - this is a table that contains the data dictionary information. It is filled by JGuiGen from your data base tables, documents your tables and is used to tell JGuiGen how you want your application to look and feel.

Running the JGuiGen Application.

   In the \com\jguigen\standard folder under the home folder where you unzipped the project, you will find a generic application called JGuiGen. This file is designed to be copied, renamed and setup as the main screen in an application that will call the JPanels that JGuiGen creates. It would probably be a good idea to view the screencasts that are located on the jguigen.sf.net home page. There are two screen casts. One walks through the options available in a JGuiGen generated application. The other waks through creating a simple GUI from a brand new table in a SQL database.

   You can compile the code and then run this file (build or ./build.sh and then use the runJGuiGen.bat or runJGuiGen.sh to run the JGuiGen application from the command line. (Note: later you can use the run or ./run.sh src.(your app) to run the application you create from the command line. These batch/script files are covered in the ReadMe.html file). There are a couple of menu options that are important for a test run.

   Users --> JGuiGen Demo - This will run a JPanel that was created using JGuiGen. This panel has been manually tweaked to create a finished edit screen. Under this menu option you can view the source code, run the JPanel, view the resource bundle or run the testcase application that tests the panel. (Note: You will need to manually close the JPanel after the testcase run.) You can also run the TestCase application that test UserDemo.java, view the java source code (in HTML format)

   If you have viewed the Screencasts, you may be ready to create your own CRUD applictation. If you have added a SQL table to the HSQL database you can test things out by pressing the Create menu option at the top of the main JGuiGen screen.


   Create - This option runs the creation portion of JGuiGen. For this sample we will create a screen called Userlogdata.java This JPanel edits the same data the User Demo does. The resulting program is exactly the same as the one I used to create the User Demo option.

   When you click on the create option a Create Screen appears on the left side of your screen and the main JGuiGen application screen gets iconized (minimized on your screen). The screen is way to the left so that it can remain visible when the application you generate appears.


Create Screen  

 

quickcreate.png  

        
 
        
 
ComboBox - Pick a class/table to work with from this list. The list is determined from  
the SQL database you are working with. The "Y" or "N" at the end of each item indicates  
if you have processed this class/table before.  
 
   CREATE - Click on this button and a CRUD GUI will be generated, compiled and run. It will pop up as soon as it is ready. You can work with it immediately and see if it does what you want. If not, you can make changes, click on the CREATE button again and  


BANG! Your new application will appear.

There are some other buttons you can use. Here is what they do. (The Advanced Checkbox will be covered at the end of this screen.)  


REFRESH - You use this button only if you have changed the structure of a table in your SQL database.  


CLASS - Edit things that relate to the whole class you just created here. The table you are working with will be automatically selected for you.  
 

CLASS Edit Screen
data_dictionary_edit_table.png


COLUMN - When you open this screen, the screen will fill with data about the columns of the table you have chosen. The components on the screen that are only relevant to columns become non-editable and those that describe the GUI you want to generate for this table are editable. The elements on the screen allow you to describe each column from the SQL table that you will include in your GUI. You can enter the tooltip, decide which type of visual components you will use to render the column and much more. JGuiGen comes with a table called userlogdata. This table is used to demonstrate features of JGuiGen and to exercise most of the options available in JGuiGen. While you are editing this screen - press the help button for a description of all of the options and what they mean.  
 

COLUMN Edit Screen  

data_dictionary_edit_column.png  

 
(CODES BANK) - When you choose some of the more advanced java visual components you will need to supply additional information before the java code can be generated. For example if you wish to put M for male, F for female and U for Unknown into a char column in your table using a radiobutton, you will need to tell JGuiGen about the radio buttion group. In this case you need to tell JGuiGen that the group will contain three buttons names Male, Female and Unknown and what to put into the table when one of the buttons is selected. The Codes Bank table is where you supply this infomation. You supply a code (in this case "gender") and enter one record for each radio button you want in your group. This screen pops up over the Column Edit screen when you need it.  
 
 

data_dictionary_codes_bank.png


   
ORDER - You can modify the order that columns will be inserted into your final application by choosing the ORDER option, highlighting a column name and clicking on the up or down arrow to move the column name relative to the other names. When you EXIT this screen your sort order is saved to the data_dict table.



I18N - All of the prompts, message, (and even the comments in the code) are internationalized. This means that they can be translated into different languages. The prompts and what the user actually sees is stored in a table. You can edit these using the menu options. You need to write these data our before the application you can generated can find it. This uses properties files. One text file is created for each language you have translated you application into. One nice thing here. Once one JGuiGen application has been translated most of the work for additional applications will already have been done. The tools tips for the menu options, and warning messages, the error messages, etc. are common to all generated applications.

I18N Edit Screen
jguigen_i18n.png


RUN - runs the generated application if it already exists.

RUN JUnit - runs the automatically generated JUnit test on the generated class (as soon as it exists.  
 
Exit and Help are obvious.  
 
 
ADVANCED CHECKBOX - When this box is checked several features are enabled.  
 
1.. When you click on the REFRESH button and exit the MARK Table screen you will be given an option to "Removed Flags" When a new column is added to the data_dict tablr or when an existing column changes size or shape the column is flagged as NEW or CHANGED. As code is being written all references to these columns have comment //NEW NEW or //CHANGED CHANGED around all of the code that is related to the new or changed columns. At some point in time you will want to stop considering these columns new or changed. When you are ready you "Remove the Flags".  
 
2. When you click on the CREATE button you will be given a couple of options to view and overwrite the TableModel class. The biggest difference is that you will see this screen before the actual java code is written.  
 

advancedcreate.png  

 

This screen lets you 1) write Java or 2) HTML code. 3) You can change the name of the class that will be created and 4) you can access the Codes Bank screen directly.