Package edu.rice.cs.drjava.ui

The ui package contains classes for the default user interface for DrJava.

See:
          Description

Interface Summary
SingleDisplayModelListener Extension of GlobalModelListener for SingleDisplayModels.
 

Class Summary
AboutDialog About dialog.
AboutDialog.ImageInfo  
AboutDialog.LogoList  
AWTExceptionHandler This class is called everytime an uncaught exception propogates to an awt action.
BorderlessScrollPane DrJava's version of a JScrollPane, which initializes the border to DEFAULT.
BorderlessSplitPane DrJava's version of a JSplitPane, which initializes the border to null.
ClasspathFilter A file filter for files with extensions ".jar" and ".zip".
CommonCloseButton Common button that can be instantiated to create close buttons with any ActionListener to notify, or not, if you so choose.
CompilerErrorCaretListener Listens to the caret in a particular DefinitionsPane and highlights the source containing CompilerErrors as appropriate.
CompilerErrorPanel The panel which houses the list of errors after an unsuccessful compilation.
DebugPanel Panel for displaying the debugger input and output in MainFrame.
DefinitionsPane The pane in which work on a given OpenDefinitionsDocument occurs.
FindReplaceDialog The tabbed panel that handles requests for finding and replacing text.
HelpFrame The frame for displaying the HTML help files.
HelpFrame.ConsolidatedAction  
HelpFrame.HistoryList  
HelpFrame.ResourceAction  
HistorySaveDialog Displayed when the user chooses to save the interactions history.
InteractionsHistoryFilter A file filter for files with extensions ".hist".
InteractionsPane The view component for repl interaction.
InteractionsPaneTest Test functions of InteractionsPane.
JavaSourceFilter A file filter for files with extensions ".java" and ".gj".
JUnitErrorCaretListener Listens to the caret in a particular DefinitionsPane and highlights the source containing JUnitErrors as appropriate.
JUnitPanel The panel which displays all the testing errors.
KeyBindingManager Contains Hashtables that are used in the key-binding process along with methods to build them and access their contents.
LineEnumRule The row header of the DefinitionsPane which displays the line numbers
MainFrame DrJava's main window.
MainFrameTest Test functions of MainFrame.
OutputPane The view component to which System.out and System.err is redirected when DrJava is run.
PreviewFrame DrJava's print preview window
PreviewFrame.PageChangerUpdater  
RecentFileManager  
RecentFileManagerTest Test functions of RecentFileManager.
SingleDisplayModel A GlobalModel that enforces invariants associated with having one active document at a time.
SingleDisplayModelTest Test functions of the single display model.
SingleDisplayModelTest.SDTestListener A SingleDisplayModelListener for testing.
TabbedPanel Extended by all panels that can dynamically be added or removed from the _tabbedPane in MainFrame.
UncaughtExceptionWindow Displayed whenever an uncaught exception is thrown and propagates back to an action.
 

Package edu.rice.cs.drjava.ui Description

The ui package contains classes for the default user interface for DrJava. The interface allows multiple documents to be open, but requires that exactly one document is active at any time, since only one document is displayed in the GUI. This is enforced by subclassing the DefaultGlobalModel in the model package to add additional constraints to the logic and state of DrJava, while maintaining the separation from the pure user interface classes.

Additional Logic

The SingleDisplayModel is a subclass of DefaultGlobalModel, primarily providing the constraint that exactly one document is active at any time. It adds public methods for getting and setting the currently active document to the interface provided by GlobalModel, and fires a corresponding event through the SingleDisplayModelListener class, which is a subclass of GlobalModelListener.

Note that this behavior is not included in the DefaultGlobalModel because the notion of a single active document is specific to this user interface. Alternative GUIs might choose to display multiple documents simultaneously, eliminating the need for this additional constraint. Housing this logic in a subclass of DefaultGlobalModel, rather than in MainFrame itself, allows us to verify through unit tests that only one document can be active.

User Interface

The graphical user interface is implemented in Swing and is coordinated through the MainFrame class. The general layout and primary components of the interface are shown in the image below.

DrJava GUI

MainFrame

The MainFrame is the JFrame which houses all other components of the GUI. It is solely a means of displaying the state and logic kept within its SingleDisplayModel, and maintains as little state of its own as possible. The MainFrame consists of a JMenuBar containing the menus, current filename, and toolbar buttons, together with a collection of panes for displaying the various components of DrJava. These include a scrollable JList with the OpenDefinitionDocuments, a DefinitionsPane for displaying and editing the source code, and a tabbed pane at the bottom which houses the InteractionsPane, CompilerErrorPanel, and OutputPane.

In addition to setting up the GUI and passing action requests to the model, MainFrame is also responsible for listening to events fired by both the GlobalModel and the document itself, in order to keep the display current.

Other Components