The Graphical Toolbox, a set of UI tools, makes it easy to create custom user interface panels in Java™.
You can incorporate the panels into your Java applications, applets, or iSeries™ Navigator plug-ins. The panels may contain data obtained from the iSeries, or data obtained from another source such as a file in the local file system or a program on the network.
The GUI Builder is a WYSIWYG visual editor for creating Java dialogs, property sheets and wizards. With the GUI Builder you can add, arrange, or edit user interface controls on a panel, and then preview the panel to verify the layout behaves the way you expected. The panel definitions you create can be used in dialogs, inserted within property sheets and wizards, or arranged into splitter, deck, and tabbed panes. The GUI Builder also allows you to build menu bars, toolbars, and context menu definitions. You can also incorporate JavaHelp in your panels, including context sensitive help.
The Resource Script Converter converts Windows® resource scripts into an XML representation that is usable by Java programs. With the Resource Script Converter you can process Windows resource scripts (RC files) from your existing Windows dialogs and menus. These converted files can then be edited with the GUI Builder. Property sheets and wizards can be made from RC files using the resource script converter along with the GUI Builder.
Underlying these two tools is a new technology called the Panel Definition Markup Language, or PDML. PDML is based on the Extensible Markup Language (XML) and defines a platform-independent language for describing the layout of user interface elements. Once your panels are defined in PDML, you can use the runtime API provided by the Graphical Toolbox to display them. The API displays your panels by interpreting the PDML and rendering your user interface using the Java Foundation Classes.
The Graphical Toolbox provides you with two tools and, therefore, two ways of automating the creation of your user interfaces. You can use the GUI Builder to quickly and easily create new panels from scratch, or you can use the Resource Script Converter to convert existing Windows-based panels to Java. The converted files can then be edited with GUI Builder. Both tools support internationalization.
Two windows are displayed when you invoke the GUI Builder for the first time, as shown in Figure 1:
Figure 1: GUI Builder windows
Use the File Builder window to create and edit your PDML files.
Figure 2: File Builder window
Use the Properties window to view or change the properties of the currently selected control.
Figure 3: Properties window
Use the Panel Builder window to create and edit your graphical user interface components. Select the desired component from the toolbar and click on the panel to place it where ever you want. The toolbar also facilities for aligning groups of controls, for previewing the panel, and for requesting online help for a GUI Builder function. See GUI Builder Panel Builder toolbar for a description of what each icon does.
Figure 4: Panel Builder window
The panel being edited is displayed in the Panel Builder window. Figure 5 shows how the windows work together:
Figure 5: Example of how GUI Builder windows work together
The Resource Script Converter consists of a two-paned tabbed dialog. On the Convert pane you specify the name of the Microsoft® or VisualAge® for Windows RC file that is to be converted to PDML. You can specify the name of the target PDML file and associated Java resource bundle that will contain the translated strings for the panels. In addition, you can request that online help skeletons be generated for the panels, generate Java source code skeletons for the objects that supply data to the panels, and serialize the panel definitions for improved performance at runtime. The Converter's online help provides a detailed description of each input field on the Convert pane.
Figure 6: Resource Script Converter Convert pane
After the conversion has run successfully, you can use the View pane to view the contents of your newly-created PDML file, and preview your new Java panels. You can use the GUI Builder to make minor adjustments to a panel if needed. The Converter always checks for an existing PDML file before performing a conversion, and attempts to preserve any changes in case you need to run the conversion again later.
Figure 7: Resource Script Converter View pane