Control Panel

This is the top-level window that contains top-level menus, the message window, and if the virtual desktop is on, the browse/project window and the virtual desktop. The empty space on the right of the menu bar and the desktop support file dropping (drag and drop).


 
 

File Menu

New File - opens an empty CSD window for the selected language. Recently opened and currently open files will appear under the main menu, other files will be under the "Other" submenu.

Open File - brings up an open file dialog.

Recent Files - allows recently closed files to be re-opened.

Search Multiple Files - brings up the multi-file search dialog.

Save All Files - saves files in all CSD windows. The user will be warned and given a chance to cancel if modified files exist.

Close All Files - closes all CSD Windows. The user will be warned and given a chance to cancel if modified files exist.

Sync Files - checks file modification times for all files in jGRASP with those on disk. For each file that has been modified outside of jGRASP, the user is given the option of reloading the file from disk. If the user chooses not to reload, the next check will report a modified file only if there is an additional modification. A save operation, however, will give an external modification warning even if there is not an additional modification.

Save Current Workspace - saves all the current top-level settings: the desktop, global settings, and current project. This happens at exit anyway, so this is provided only for protection against a crash.

Exit jGRASP - quits the application. If a compile process is active and there are modified files, this will not be allowed.


 
 

Project Menu

Note that any operation that closes a project will save it first. It is not possible to discard changes to a project (unless jGRASP crashes or is killed).

New Project - allows the user to create a new empty project.

Open Project - allows a saved project to be opened.

Close Project - closes the current project and opens the default project.

Save Project - save modifications to the project immediately. This is never necessary, except to be safe against a crash.

Save Project As - allows the user to save the current project under a new name.

Recent Projects - allows the user to open recently closed projects.

Add Files To Project - opens a dialog that allows the user to add files to the project. This dialog allow files to be added with absolute paths or paths relative to the project file location (if the project is named and the file(s) are on the same file system (drive) as the project file). The relative paths are also platform independent.

Remove Selected Files From Project - remove any files selected in the project window.

CSD Window Settings For Project - brings up a csd window settings dialog for the current project and selects the "CSD" tab.

Compiler Settings For Project - brings up a csd window settings dialog for the current project., and selects the "Languages" tab.

Print Settings For Project - brings up a print settings dialog for the current project.


 
 

Settings Menu

Virtual Desktop - turns the virtual desktop on and off. When the desktop is turned on, all CSD windows are moved onto the desktop.

Focus Follows Mouse - when on, you can set keyboard focus to CSD windows and most other text-entry windows in the virtual desktop by moving the mouse over them. Unfortunately, using the mouse in a CSD window on the virtual desktop will still raise it to the top, but you can type and use keyboard accelerators in a non-top-level window.

CSD Window Popup Menu Enabled - when on, there will be a popup editing menu for CSD windows. The particular mouse event that triggers the popup is determined by the JVM and Look-And-Feel. On Windows, Solaris, and Linux JVMs, the event is generally any right mouse click. Turning this off allows you to use the CSD window right click function that selects tokens with one click, and levels of enclosing braces with more clicks.

Auto Save - if on, modified files are saved before a compile operation. Otherwise, modified files are temporarily saved before a compile operation.

Auto Sync - if on, check file modification times every time the control panel is activated. You would almost certainly not want this on if you are in a focus-follows-mouse environment (if you are using Windows, you are not in a focus-follows-mouse environment). See Sync Files.

Verbose Messages - if on, compile, run, and CSD generation functions will give detailed messages about their operation.

CSD Window Settings - opens a CSD settings dialog for the global or project settings, and selects the "CSD" tab.

Compiler Settings - opens a CSD settings dialog for the global or project settings, and selects the "Languages" tab.

Print Settings - opens a print settings dialog for the global or project print settings.

Administrator CSD Window Settings (Administrator Only) -  opens a CSD settings dialog for the administrator settings, and selects the "CSD" tab.

Administrator Compiler Settings (Administrator Only) -  opens a CSD settings dialog for the administrator settings, and selects the "Languages" tab.

Administrator Print Settings (Administrator Only) - opens a print settings dialog for the administrator print settings.

Look And Feel - allows the look and feel to be changed. This may alter some gui element positions slightly. The size and alignment of some interface elements may be slightly off due to Swing bugs.


 
 

Window Menu

Refresh Window - causes the main window to be repainted.

Cascade - lays out the windows in the virtual desktop in a cascade.

Cascade and Resize - lays out the windows in the virtual desktop in a cascade and sets them to their default sizes.

The rest of the items represent currently open CSD windows, and allow the user to pop them up.


 
 

Tools Menu

Regular Expression Tester - pops up a testing tool for Perl5 regular expressions, which are used in compiler error formats.

Autotest - Brings up the autotest dialog.

Run Garbage Collector - frees unused memory (in jGRASP itself) immediately.


 
 

UML Menu

Show UML Window - Brings up the UML window.

Generate/Update UML - Brings up the UML window and updates the UML diagram.


 
 

Open File Dialog

A dialog for opening files.

Filters for the languages supported by jGRASP are provided, as well as the "all files" filter. Note that language filters classify files based on the extension only if they have not been opened in jGRASP before. Once a file is opened, jGRASP remembers that language. The default language for files with a ".h" extension can be set to C++ or C only (not both) by changing the extension settings for C or C++ (see settings).

You can also type a list of extensions into the "Filter Extensions" field to filter by extensions. These must be separated by whitespace, and can start with ".", "*.", or nothing. For example: "*.c *.cpp", ".c .cpp", and "c cpp" will all show only files that end in ".c" or ".cpp".

The language may be forced at load time using the language pulldown menu. This only applies to files that have not been previously opened in jGRASP. Once a file is opened, its language is remembered.

The Text / Binary radio buttons allow the file to be opened in text mode (UNIX, DOS, and Mac. line terminators accepted) or binary mode (only newlines are line terminators).


 
 

Autotest Dialog

This dialog will self-test jGRASP CSD generation against a batch of selected files. You can help us test CSD generation by running autotest on your code. If autotest indicates an error, load the file that caused the problem into jGRASP (probably by clicking on the error message) and generate a CSD. Note if a CSD will not generate, or if there is an obvious error in the CSD diagram. If you believe your source code is valid (and there is not a diagram error caused by a macro or include file in C or C++ code), you can send us the code that shows the problem (or a mocked-up piece of code, if that is not possible). The chances are good that we will fix the problem quickly.

Note that autotest may take some time if you apply it to a lot of code.

Here are the tests performed on each file, and for various combinations of CSD properties (boxes on/off, forced newlines on/off, etc.):

A CSD is generated, which tests the validity of the parser (assuming the source code is valid).

The CSD is compared to the original code to make sure the code was not altered (this test is done every time a CSD is generated).

The CSD diagram is tested against a set of rules for a well-constructed CSD. C and C++ code that uses macros or has partial structures in include files may fail this test, and this may not indicate a problem.

A second CSD is generated from the first to test for stability. That is, to make sure CSD(CSD(source) = CSD(source).


 
 

Browse Window

This window acts as a file browser.

A combo box shows the current directory. You can type a new directory in directly and hit "Enter" to change to that directory. The "Save Current Directory" item will store the current directory in the combo list. "Clear" will clear the list.

Filters for the languages supported by jGRASP are provided, as well as the "all files" filter. Note that language filters classify files based on the extension only if they have not been opened in jGRASP before. Once a file is opened, jGRASP remembers that language. The default language for files with a ".h" extension can be set to C++ or C only (not both) by changing the extension settings for C or C++ (see settings).

You can also type a list of extensions into the filter pulldown and hit "Enter" to filter by extensions. These must be separated by whitespace, and can start with ".", "*.", or nothing. For example: "*.c *.cpp", ".c .cpp", and "c cpp" will all show only files that end in ".c" or ".cpp".

Clicking on a file will open it (in text mode).

Clicking on a project will attempt to open it. If it does not appear to be a jGRASP project, it will be opened as a file.

A pop-up menu allows selected files to be opened (in text mode) or added to the current project with either relative (to the project file location) or absolute paths.


 
 

Project Window

his window displays files in the currently open project. For now, only one project can be open at a time, in the future this will probably change.

Clicking on a file will open it  (in text mode).

A popup menu allows selected files to be opened or removed from the project.


 
 

Message Window

The message window contains tabbed pages for compiler messages, messages from jGRASP (CSD generation, non critical errors and warnings), and an i/o window for the run function.

Color settings for these pages use CSD color settings. Some of these are specific to the message pages. They can be set on the CSD window settings CSD text page.

Clicking on an error in the compile and jGRASP message pages will open the file referred to in the message (if not already open) and select the line referred to in the message. If line numbers are frozen in the CSD window, the frozen line number will be selected. The format for click-to-error in the compile message page is determined by the compiler settings. The paths that will be searched if the line contains a relative path name or Java class name are specified on the sources page of the CSD window settings (global and project only).

The compile and jGRASP message pages have a "Copy" button. This will copy the selected text, or all text if the is no selection, to the clipboard.

The compile page has a "Stop" button that will kill the compile process. If this button is enabled it means a compile process is active.

The run page provides i/o for the run function. A "Kill" button allows the running process to be killed. If this button is enabled it means a "run" process is active.

All three pages have a "Clear" button that clears previous output.


 
 

Projects

A jGRASP project consists of a file list, and CSD and print settings (see settings). For now there are very few operations on projects; they mainly provide compiler environments through the CSD settings.

There is always an active project; if no project has been loaded, a default project is active. The current project is displayed at the top of the control panel.

Any operation that will close a project, such as quitting jGRASP or opening another project, will first save the current project. There is no way to discard changes to a project, except by killing jGRASP.

The project window displays the current project and the files it contains.

The project menu allows projects to be opened, saved, and modified.


 
 

Multi-file Search Dialog

This dialog allows multiple files to be searched. The results are reported to the jGRASP Message window, in a clickable format. Row and column numbers in the results assume the file will be opened in text mode (as will happen if you click on a result and the file is not already open). If the file is opened in binary mode, the column number will be off by one for any line for which the previous line is terminated by "\r\n".

Filters for the languages supported by jGRASP are provided, as well as the "all files" filter. Note that language filters classify files based on the extension only if they have not been opened in jGRASP before. Once a file is opened, jGRASP remembers that language. The default language for files with a ".h" extension can be set to C++ or C only (not both) by changing the extension settings for C or C++ (see settings).

You can also type a list of extensions into the "Filter Extensions" field to filter by extensions. These must be separated by whitespace, and can start with ".", "*.", or nothing. For example: "*.c *.cpp", ".c .cpp", and "c cpp" will all show only files that end in ".c" or ".cpp".

Files and directories can be selected. For each directory selected, any files in that directory matching the selected filter will be searched. If no files are selected and "Search Project Files" is off, the current directory will be searched. To select no files, you may need to enter a non-existent filename for "File name".

Search Pattern - the text or pattern for which to search.

Pattern Type

Plain Text - match the search text. A search will begin at the end of the previous match.

Awk/Grep Reg. Exp - match extended awk/grep style regular expression. A search will begin at the end of the previous match.

Perl5 Reg. Exp. - match a Perl 5 regular expression. A search will begin at the end of the previous match. If the pattern contains no groups, the whole match will be reported. Otherwise, there will be a match for each matching group. For example, the pattern  t(e)s(t) will result in two matches for "test", one for the "e" and one for the second "t". Zero-length groups are allowed, but the selection will be one character long. For example,  t(\S*)est  will select the "e" in "test". See the perlre man page for a description of the pattern format.

Case Sensitive - if on, the search will be case sensitive.

Search Subdirectories - if on, subdirectories of any directories in the search will be recursively scanned. Any files in the matching the selected filter will be searched.

Search Project Files - if on, all files and directories in the current project will be searched.

Max. Results Per File - specifies the maximum number of matches that will be reported for each selected file.


 
 

Help Us Test CSD Generation

You can help us test the jGRASP CSD generator by running the autotest on groups of your source files. The autotest dialog is on the "Tools" menu of the control panel. See autotest dialog for a description of its use.