Download Online Help

Transcript
9 Designing the Initial Prototype
After it had been decided to use JavaHelp to implement Online Help the work on the
first prototype could be started. The first step was to create a new branch for the code in
the source control program ClearCase, both to protect the original code and to make
sure that the code for this thesis was safely backed up.
9.1 Building the Prototype
With this done it was time to start on the prototype. In order to get more familiar with
the code the first thing that was implemented was a Help menu in the interface with the
same options as in the mock-up mentioned earlier (see chapter 7).
To start things of a help class called MMIHelp was created to handle the creation of a
HelpSet variable that is linked to the helpset file as well as a HelpBroker variable
that is created from the HelpSet variable and handles all the JavaHelp operations. This
class was written as a Singelton class so that only one instance of it can exist at a
time, or else the JavaHelp would start to malfunction. To make things easy in the
beginning the same help files that were used on the test GUI was used here as well. The
menu item Help Content under the Help menu was then set to open the online manual
when pressed.
But the online manual should also be available when pressing F1 in a window or side
panel. The starting point of the Online Help implementation was at a side panel called
Weapon Engagement Status, the reason for choosing this panel was that it contained a
table as well as a few checkboxes and labels, and therefore a perfect place to start
testing the Pop-up windows. But before that the panel was linked to a page in the online
manual with the enableHelpKey() function, so that that specific page was opened
when the F1 key was pressed. Implementing the Pop-up help was not that complicated
either, at least not for the checkboxes. First of all the enableHelp() function was used
to link topic IDs to the checkboxes and a mouseListener was added to those same
component. The responding function was programmed so that when the middle mouse
button was clicked on such a component a new Pop-up window would be created that
showed the topic that corresponded to that component. The Pop-up window was closed
and destroyed as soon as something else outside the Pop-up was clicked.
This was easily done for the checkboxes, but it was not as easy to implement in the
table headers. The problem here is that the table headers in a JTable lies under a single
component that can be gotten by using the function getTableHeader() on the JTable,
the table headers themselves have no components of their own. The solution to this
problem was to make some changes to the TableModel of the JTable. The project code
contains a class called ColumnDefinition that contains information about the columns
in a table, like max- and minimum size among others. This class was edited so that the
topic ID was included as well for each column. In order this to actually work it has to
be included into the TableModel somehow, fortunately the TableColumn class that the
TableModel uses contains a variable called identifier that is not used for anything.
This variable is of the type object the most basic type in Java and can therefore be set
any type, in this case a topic ID. Setting it to a topic ID is done at the same time as the
configuration of the table is done.
35