Generated Application Features
[Previous] [Main] [Next]

Generated Application Features - Details

JGuiGen comes with a generic main screen that mostly consists of a set of menus and a system title. You use this screen to launch the other screens generated by JGuiGen. This screen will be covered in more detail later.

JGuiGen generates a JPanel for each table. Here is a more detailed description of the features included in the JPanel.

1. Each JPanel comes with a MAIN method that it can be run as an independent application for testing and debugging. This main method shows how to integrate a call to the screen into a larger application. The main method also has several optional features that a devoper can toggle on in their editor. These features allow for easy testing of different locales or different look and feels.

2. JMenu - The standard buttons can be configured to show at the top of the screen or at the bottom. They can also be configured to have icons and/or text. Each button comes with a tool tip and the accessible name and description filled in.

3. PopUp menu with the same options plus an option that allows users to pick a Look and Feel.

·Menu Option - Exit - The system will notify you if you are about to lose changes to the current record and then will close the screen. Current look and feel information and the size and location of the panel are saved with Java's user preferences system. When the panel is reopened it starts with these defaults. The MAIN method in the class shows how to insure that all of the memory used by the JPanel is released with the user closes the window.  

·Menu Option - Delete - You can configure this option to really removed the record from the table or you can indicate a field that will be toggled to indicate that the record is 'inactive."  

·Menu Option - Add - empties all visible components and prepares the screen to enter data for a new row in the table. When you press this button the system will notify you if you are about to lose data that you have changed and allow you to save that data. Two other checks are made. One checks forthat aill fields marked required are filled in. This section can also include more complext cross-components tests that you hand code. For example if the persons says they NO to "own a car?", the number of doors their car has should be missing or zero. The developer will need to add these additional tests that the data must pass. The Save button will update existing rows and insert new rows. The button is normally a "Save" button. After you press the Add button, the data is cleared from the screen and the "Save" button becomes an Add button. After you add a row, the button reverts to being a Save button.  
·Menu Option - Find - A relatively simple query maker screen is included. Users click on drop down menus and fill in information and the system creates a SQL WHERE clause. This WHERE clause is used to populate the JTable with selected records. You can save these generated WHERE cluases and you can also launch a report from this menu.  

·Menu Option - Extra - This option brings up a secondary screen with several dummy options on it. You can modify the class called by this menu option to carry out special tasks relevant to your needs.  

·Menu Option- Save - checks for required fields or conditions and then saves the data. If you have identified a timestamp field to update every time a record is changed, the system will automatically check to see if the tamestamp changed since you started editing the row. It will abort the update if another user has entered changes that you are about to overwrite. The system will notify you if required fields are missing or if the row you are about to save fails other integrity checks.  

·Menu Option - Print - This will print the current screen. It resizes the screen so that it will fit on a standard 8 1/2 x 11 pieces of paper.  

·Menu Option - Help - This calls up the Java Help system. There can be one screen (or more) dedicated to each panel created by JGuiGen.  

·Optional Menu Option - Replicate - This activates the replication system and updates data with a remote site.  

·Menu Option - Select Look and Feel (only available on the popup menu). Your user will see a list of available look and feels and can select one. The system will remember the last look and feel chosen and will start the application with this look and feel when it is next run by this user. One of the look and feels is a special Low Vision / High Contrast look and feel for users who are visually handicapped. Another is a mono look and feel and system look and feel that duplicates your OS default colors.  


·Menu Option - Dup (only available on the popup menu) - this will create a copy of the current row. The only thing changed will be the id number.  


·Menu Option - Next (only available on the popup menu) - this will move the scrolling table at the bottom of the screen to the "next" record.  


·Menu Option - Previous (only available on the popup menu) - this will move the scrolling table at the bottom of the screen to the "previous" record.  


·Menu Option - Refresh Table (only available on the popup menu) - this will query your data table and put new data into the scrolling list at the bottom of the screen.  
·Menu Option - Freq Count (only available on the popup menu) - this will show you a small screen that contains a frequency count (with percentages for each value) on the column that was last sorted in the scrolling table. If the column is numeric this table also shows you the mean. You can mark selected values as "missing" and the table will recalculate the percentages and mean ignoring the missing values. This table "remembers" the items you marked as missing when you ask to frequency count the same column later. You can export the frequency count to an Excel spreadsheet and the PC clipboard.  
·Menu Option - Change Font (only available on the popup menu) - you can select a font and see the screen layout using that font.  
·Menu Option - Switch Look and Feel (only available on the popup menu) - you can select from sevaral available look-and-feels. Some of them are special to JGuiGen and some are unique to the operating system you are running the application on.  
·Menu Option - Change Locale (only available on the popup menu) -- you can chose to run the application using a language other than the one your PC defaults to.  
·Menu Option - A11y (only available on the popup menu) - This menu option has two sub-menu options. One the brings up a magnifying screen (at the right of your main screen) and one that brings up a screen for telling how accessible each visual component is. This screen changes as the mouse moves over different parts of your GUI.  
·Menu Option - Set Browser and Word Processor path (only available on the popup menu) - This brings up the same options you see when you a JGuiGen application for the first time on a new PC. You select the path and executable file name for your browser and word processor.  

4. The screens generated by JGuiGen can be multi-user safe. One of the options in the DataDictionary screen allows you to indicate a column that will automatically be filled in with the date/time stamp the row was updated. If you have a column marked for this purpose, the generated code will automatically check to see if the time stamp has changed when you try to update the row. If it has changed then someone must have changed the row while you were editing. The user is notified (apologettically) that the update is being aborted in order to avoid overwriting someone elses changes.

5. JTable - there is an optional JTable created at the bottom of the gemerated application screen. This contains columns from the original SQL table that you choose in an order you choose.

·Clicking on any column header sorts the table on that column. Clicking again resorts the table in the opposite direction. This sort is internationalized.  
·Users can drag columns to a different order. They can also resize columns by dragging the edges of the column headers. These changes are saved when the screen is exited and reused when the user reopens the screen.  
·These column are also used by the report writer. Drag the columns you want to the left side of the screen, set an options filter and tell the report writer how many columns you want to include in the report.  
·Clicking on any String or Text field pops up a special viewer so that you can see long text messages.  
·Special renders are used for fields like dates, money, and floating point numbers.  
·Clicking on a row first checks to see if your user has unsaved changes on the current screen and allows them to save the changes if they wish. Assuming there are no unsaved changes or that the user has decided to abandon those changes, the system will query the table for new data from the row clicked and then will begin to edit that row.  
·Changes SAVED will be reflected in the JTable. If a new row is ADDED, the JTable will be refilled. (The Hypersonic SQL database used in JGuiGen samples does not allow the JTable to be updated.)  

6. All code generated by JGuiGen can run in from a class, a jar or as part of a Java Web Start application. This means that components like icons are loaded differently depending upon how the application is being run. When an application runs from a jar (or a Java Web Start jar), a special classloader is used and the applications expects the icon to be in the jar. When the class is being run from a file system, the system automatically finds the location of the base class in the application, and looks for an images folder under that folder. The icons and images are located in this folder (or in subfolders for cases when images are different for some locales.)

7. The JPanel's generated are internationalized.
·All of the text, hot keys, tool tips, etc are written to a resource bundle. The system then checks for language and country specific versions based upon the user's default setting.  
·The help file system checks to see if a version is available for the country and language of the user before it defaults to the main help file.  
·Images and icons check for language and country specific versions.  
·Optional titled borders around individual fields on the screen can be used to clarify where information is to be entered. For things like Family Name and Given Name where the default location varies from one language to the next this can be very useful.  
·Date, money, number representations, fonts, and character sets use Java's internationalization locale's to display correctly for each language and country.  
·A resource bundle file is generated every time you generate a screen. The fields in the screen that need translating are in this resource bundle.  

8. The JPanels are set up to work with Assistive Technology. Viewers for the Visually impaired will find that all of the fields and components have accessible names and descriptions. This includes the JTable. A special screen pops up during testing to show you the accessibile information specific to each component you move your mouse over. The screens are keyboard enabled as much as possible.

9. The applications are keyboard accessible. Each label can be given an internationalized hot key.

10. Each application screen (optionally) has a FIND button. This button brings up a simple to use query builder. You can also create and run a report from this screen.

11. The JGuiGen generated panels automatically create create two javaBeans (a class with variables for each column in your table and getter and setter methods to put data into the bean and take it out.) One of these beans contains the data in a given row before your edit and one contains the data after your edit. When when user creates an event on the screen that might result in lost data the value of each component in the two beans is compared . If any of the data has changed, the user will be shown a list of changed fields and be given an option to avoid losing these changes. Events that could result in lost data include 1) pressing the ADD button (in order to set the screen up to add a row), 2) clicking on the "window close" button at the top of the screen, 3) clicking on the EXIT button to close the screen, 4) clicking on the FIND button to refill the JTable with selected rows, 5) clicking on a different row in the JTable (which will fill the components with the values from that row), 6) clicking on the DUP option in the Pop-up menu, 7) clicking on the NEXT ROW option in the pop-up menu, 8) clicking on the PREVIOUS ROW option in the pop-up menu and 10) clicking on the REFRESH TABLE option in the pop-up menu.

12. Before a SAVE or ADD is executed the JGuiGen generated panel automatically checks for errors in the data. Any fields the developer marked as "required" in the DataDictionary edit step will automatically have a test here to make sure that they contain data. You can also set some field so that they must be between two values - a minimum and a maximum. The developer can manually add additional tests in the method that carries out these integrity tests to insure data integrity. For example if your screen had a "own a car?" question and a "Number of doors on your car?" question, it would obviously not be valid to have doors on your car when you do not own a car.

13. The Java system comes with a help system that will pop-up screen or field level help screens. All JGuiGen generated screens automatically assume that such a help file exists. The help file will be located in a folder called HELP under the main application forlder. If there is a specific help version for different languages, the program will automactially look in a subfolder with the language or language/country codes standardly used for I18N. For example, a Spanish help file would be in a HELP/ES folder. A special spanish version for people in Mexico would be in a HELP/ES_MX folder.

14. Each screen comes with a PRINT button that does a print screen. This method will shrink the screen so that it will fit on to a standard 8 1/2 x 11 piece of paper.

15. JGuiGen panels automatically hook themselvers into a special console screen. This "LOG" screen is minimized by default. All SQL accesses are logged onto the screen. If an error occurs, a small window will pop-up on the upper right hand corner of the users screen notifying them that they should look at the LOG screen to see the error. (There are also WARNINGS. This pop-up screen disappears after 10 seconds.)

16. JGuiGen generated panels automatically inherit from a class called JxFrame(). This class automatically calls up the system default look and feel and applies it to all components in the frame.

17. Each JGuiGen generated screen comes with code to override the system look and feel. The look and feel the user selects and the screen placement and size of each screen is saved using the User's preference system. When the application restarts these values are recalled and used.

18 There is an optional system to restrict individual rights to each JPanel. You can control their rights to View, Edit, Add and/or Delete each screen generated by JGuiGen.

19. When JGuiGen generated panels start, they read an XML file to determine things like the database to use, the account to use and the location of the database. This file can be used to hold many items that might change from site to site. For example, the SQL driver information is stored here in order to make it easy to change which back end you are running with. Default company information (such as a contact person to appear in error message) is found there. If the system does not find a user name and password to access the database, it reverts to querying an LDAP repository for the information. in this case the user will be required to enter a name and password to access the system.

20. There is one method in the JGuiGen generated screen that lays out the components on the screen. JGuiGen comes with a simple row layout manager that will handle many business application needs. If something more complex is needed, replacing this one method is all that is required.

21. As of JDK 1.4, java comes with a logging facility. JGuiGen generated panels log accesses and errors. More logging would be easy to add.

22. To improve accuracy of data entry, JGuiGen automatically uses special components that limit the number of characters that can be entered, force data to match a pattern (such as a telephone number) and in general insure data integrity.

23. JGuiGen panels generate standard SQL insert, update and delete calls. This makes it very easy to user the panels with any SQL backend. The only unique code that needs to be established involves inserting a new row. JGuiGen panels expect you to be able to determine the row id of the row that was just entered. For single panels accessing one table this does not make a difference. In more complex cases where you add a row to one table and then add rows to other tables using the id number from the first row added, this can be critical. PostgreSQL, MySQL, MS SQL Server and other major backends have special calls to determine this id. JDBC 3 has a generic way to determine this ID, but many of the backends to not have JDBC 3 drivers yet.

24. In the real world we get a project running and then someone wants to add something. When you add a field or change the characteristics of a field (change a char(20) field to a char(40) field for example), JGuiGen places a note (** NEW NEW or ** CHANGED CHANGED) beside every instance where a new, deleted or changed field is referenced in the code. This allows for easy manual merging of newly generated code with established and tweaked code.

25. Starts with the whole screen contained in a scrolling JPanel. This allows developers to see every component even before they have tweaked the rowlayout manager to generate the final screen they want.

26. Almost all of the methods generated by JGuiGen include the name of the table being worked with. This makes it relatively easy to cut and paste methods from two JGuiGen generated panel into one panel that would edit rows from two related tables.

27. The system comes with a routine that looks for a History.htm file. If this file is found, the date on the file is compared with the date the user last viewed the file. If the file has a newer date, the user is offered a chance to look at the file. This is used for two things: 1) Notify users of changes when the program is updated. 2) The date on the history file is logged whenever the user starts the application. This gives the developer a way to track what version of the program the user was running. The assumption here is that the developer will want to notify the users of changes. Since this file gets edited and the date is updated, this date becomes an "automatically" updated date that can be used to determine what the user is actually running.

28. JUnit Testing - Testing is a major part of today's Java programming. JGuiGen automatically creates a JUnit TestCase (using jfcUnit for Swing Component access) when you generate a screen. This TestCase screen tests the functionality of the GUI Screen. At the time of this writing the tests do the following:
·Assure that a special "testing" row in the table being edited is deleted. By default the testing row_id is 1. This can be overriden in the XML ini file.  
·Starts the JGuiGen generated panel that is empty.  
·Adds unique data into each component. For example the first JTextField might be "Text 3", and the next one "Text 4" and the next one "Text 5".  
·Clicks the ADD button to save the data.  
·Restores the components by selecting the row just added and filling the components with the data just saved.  
·Checks that each component contains the data that was just put into it. (This insures that all of the data on the screen is saved and recalled correctly.)  
·Clicks on the CLEAR button and tests that each component is empty. (This insures that when adding a new row, there is no accidental carry over from the previously edited row.)  
·There are more test planned and some issues with JFormattedText fields and JComboBox fields that need to be resolved, but the current test suite covers quite a bit.  
29. Each screen saves the user preferences. The scrolling table can be modified by dropping and dragging columns. JGuiGen saves these settings and reuses them when a user reopens the screen. JGuiGen aslo saves the Look and Feel a user selected and the size and location of each screen.