Package edu.rice.cs.drjava.ui

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

See:
          Description

Interface Summary
ClipboardHistoryFrame.CloseAction Interface for an action to be performed when the user closes the frame, either by using "OK" or "Cancel".
InteractionsController.ConsoleStateListener A listener interface that allows for others outside the interactions controller to be notified when the input console is enabled in the interactions pane.
RecentFileManager.RecentFileAction This interface is to be implemented and passed to the manager upon creation.
RegionsTreePanel.IChangeState State pattern for improving performance during rapid updates.
 

Class Summary
AbortablePanel Panel for displaying some component with buttons, one of which is an "Abort" button.
AboutDialog About dialog.
AboutDialog.ImageInfo  
AbstractConsoleController Abstract class that hooks a Swing console/interactions document with its Swing pane.
AbstractDJPane This pane class for a SwingDocument.
BookmarksPanel Panel for displaying bookmarks.
BreakpointsPanel Panel for displaying the breakpoints.
BreakpointsPanel.BreakpointRegionTreeUserObj Class that gets put into the tree.
BrowserHistoryPanel Panel for displaying browser history.
ClassPathFilter A file filter for files with extensions ".jar"/".zip".
ClipboardHistoryFrame Frame with history of clipboard.
ClipboardHistoryFrame.FrameState Class to save the frame state, i.e.
CommonCloseButton Common button that can be instantiated to create close buttons with any ActionListener to notify, or not, if you so choose.
CompilerErrorPanel The panel which houses the list of errors after an unsuccessful compilation.
ConsoleController A Swing specific console controller class that includes both a Swing InteractionsDJDocument and a GUI agnostic ConsoleDocument (wrapping the former).
DebugPanel Panel for displaying the debugger input and output in MainFrame.
DefinitionsPane The pane in which work on a given OpenDefinitionsDocument occurs.
DefinitionsPaneTest Tests the Definitions Pane
DetachedFrame  
DetachedFrame.FrameState Class to save the frame state, i.e.
DirectoryFilter A file filter for selecting directories.
DrJavaErrorHandler The handle() method in this class is called everytime an uncaught exception propagates to an AWT action.
DrJavaErrorHandler.LoggedCondition The throwable used for logging unexpected situations.
DrJavaErrorPopup Displays a popup window for the first uncaught exception or logged conditions.
DrJavaErrorWindow Displays uncaught exceptions and logged conditions.
DrJavaScrollableDialog A JDialog with a scrollable text area and a button panel.
DrJavaSurveyPopup Asks whether DrJava may contact the DrJava developers and send information about the operating system and the Java version used.
EditExternalDialog  
EditExternalDialog.FrameState Class to save the frame state, i.e.
ErrorCaretListener Listens to the caret in the associated DefinitionsPane and highlights the text containing CompilerErrors.
ErrorPanel This class contains common code and interfaces from CompilerErrorPanel, JUnitPanel, and JavadocErrorPanel.
ExecuteExternalDialog  
ExecuteExternalDialog.FrameState Class to save the frame state, i.e.
ExternalProcessPanel Panel for displaying some component with buttons, one of which is an "Abort" button.
FindResultsPanel Panel for displaying find results.
HelpFrame The frame for displaying the HTML help files.
HistorySaveDialog Displayed when the user chooses to save the interactions history.
HTMLFrame The frame for displaying the HTML help files.
HTMLFrame.HistoryList  
HTMLFrame.ResourceAction  
InsertVariableDialog Dialog allowing the user to select a variable.
InteractionsController This class installs listeners and actions between an InteractionsDocument (the model) and an InteractionsPane (the view).
InteractionsHistoryFilter A file filter for files with extensions ".hist".
InteractionsPane The view component for repl interaction.
InteractionsPaneTest Test functions of InteractionsPane.
InteractionsScriptController Controller for an interactions script.
InteractionsScriptPane Pane for an interactions script.
JarOptionsDialog  
JarOptionsDialog.FrameState Class to save the frame state, i.e.
JavadocDialog Manages a dialog box that can select a destination directory for generating Javadoc.
JavadocErrorPanel The panel which displays all the Javadoc parsing errors.
JavadocFrame DrJava's Javadoc viewing frame
JavaSourceFilter A file filter for files with extensions ".java" and ".gj".
JUnitPanel The panel that 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.
KeyBindingManager.KeyStrokeData  
LessPanel Panel for displaying some component with buttons, one of which is an "Abort" button.
LineEnumRule The row header of the DefinitionsPane which displays the line numbers
MainFrame DrJava's main window.
MainFrame.GoToFileListEntry Wrapper class for the "Go to File" and "Auto-Complete" dialog list entries.
MainFrame.JavaAPIListEntry Wrapper class for the "Open Javadoc" and "Auto Import" dialog list entries.
MainFrameTest Test functions of MainFrame.
NewVersionPopup Displays whether a new version of DrJava is available.
PreviewConsoleFrame DrJava's print preview window for a console document (interactions or console)
PreviewDefDocFrame DrJava's print preview window for a definitions document
PreviewFrame DrJava's print preview window
ProjectMenuTest Test functions of Project Facility working through the main frame and model.
ProjectPropertiesFrame A frame for setting Project Preferences
QuickStartFrame The frame for displaying the HTML quick start files.
RecentDocFrame This class extends a Swing view class.
RecentFileManager Manages a list of the most recently used files to be displayed in the File menu.
RecentFileManagerTest Test functions of RecentFileManager.
RegionsListPanel<R extends IDocumentRegion> Panel for displaying regions in a list in the order specified by indices passes to addRegion.
RegionsListPanel.RegionListUserObj<R extends IDocumentRegion> Class that gets put into the list.
RegionsTreePanel<R extends OrderedDocumentRegion> Panel for displaying regions in a tree sorted by class name and line number.
RegionsTreePanel.RegionTreeUserObj<R extends OrderedDocumentRegion> Class that is embedded in each leaf node.
ReverseHighlighter Implements the Highlighter interfaces.
ReverseHighlighter.DefaultFrameHighlightPainter Simple highlight painter that draws a rectangular box around text.
ReverseHighlighter.DefaultUnderlineHighlightPainter Simple highlight painter that underlines text.
ReverseHighlighter.DrJavaHighlightPainter This class is a wrapper for the DefaultHighlightPainter that allows us to tell whether a highlight was requested by DrJava or by Swing (as in selected text).
SimpleInteractionsWindow A standalone Interactions Window that provides the functionality of DrJava's Interactions Pane in a single JVM.
SplashScreen A splash screen window to be displayed as DrJava is first starting up.
TabbedPanel Extended by all panels that can dynamically be added or removed from the _tabbedPane in MainFrame.
 

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