UI Framework for Arch4J,
is a result of working with Swing interfaces that use a Tree for navigation. We wanted to make Swing easier to
use. It was originally designed in the early days of Swing, before it was part of the JDK, and has grown
up along the way.
You will need both the arch4j.jar and the arch4j-ui.jar file in your classpath. The JavaDoc will
give you insight into the API. The sample application, found in the source download can be executed using the runExample.bat file
in the bin directory.
|User Interface Concepts|
This is a simple layout. The window title is shown in the top of the window. There are one or more menu(s).
The toolbar is located below the menu options. The main screen is devided into a left side tree and a right
side display area. When a node is selected, a panel is displayed on the right hand side that is specific to
the selected node.
All of the components for menus, images, and toolbars are defined in an xml file as a resource. This resource file needs to be called
resources.xml and may contain several related resource elements.
|name||The name of the resource. There are some names that are used internally by the framework and you may
reference a name as part of another resource.
||value||The value of the resource. Used to indicate the text for a resource. If the resource is for
a menu or toolbar, the value is a space delimited set of names of other resources.
||label||The displayable text for menus
||command||The name of the method to invoke when the menu option or toolbar option is selected.
There are some name attributes that have special meaning:
|title||Used to configure the text in the title of the frame.
|titleBarIcon||Used to configure the icon to use for frame.
|toolbar||Used to define the contents of the toolbar.
|menuBar||Used to define the menu options.
|nodeMenu||Used to define the default pop-up menu for a node that is selected. This may be overridden for
different types of nodes.
The sample file contains defintions for the title and title bar icon. It also defines the toolbar with a value of
cut copy paste delete. This is interpreted as 4 different icons in the toolbar. The names refer to the cut
copy paste and delete resources defined afterwards. Together they define the toolbar in the illustration above.
NOTE: The icons are disabled because the methods associated with the resources are not coded. Once you code the
methods, the resources are enabled.