Implementation Issues

about GUIs

by

Adil KABBAJ

 

 

Introduction

GUIs packages/classes organization

 

Introduction

Amine Platform provides several GUIs : Amine Platform Suite GUI which offers references (as buttons) to all GUIs of the Platform, LexiconsOntology GUI which offers a GUIs for the creation, edition and exploitation of ontologies, CGNotations GUI which is an MDI, multi-lingua and multi-notation (LF, CGIF and Graphic) CG editors, and CGOperations GUI which enables the application of various operations on specific CGs. Amine's engines will provide their own GUIs (GUIs associated to dynamic ontology, Prolog+CG and Synergy). This document presents some detail about the organization of Amine GUIs classes and packages.

 

GUIs packages/classes organization

The current four GUIs (LexiconsOntologyGUI, CGNotationsGUI, CGOperationsGUI, and AminePlatformGUI) are implemented as four packages contained in guis package. This package contains also another package, called util, which contains classes used by the four GUIs. Each GUI can be called directly from a console, as a stand-alone application. Indeed, each GUI package has a class with the main method that activates the GUI's main frame:

  1. LexiconsOntologyGUI has the main class OntologyGUI and the main frame OntologyGUIFrame,

  2. CGNotationsGUI has the main class CGNotationsGUI and the main frame CGNotationsGUIFrame,

  3. CGOperationsGUI has the main class CGOperationsGUI and the main frame CGOperationsGUIFrame,

  4. AminePlatformGUI has the main class AminePlatformGUI and the main frame AminePlatformFrame,

The four GUIs above share several resources and their main frames are organized in a hierarchy, presented in Figure 1 and commented below.

Figure 1: GUIs main frames hierarchy

Comments

  1. JFrame, the root of the hierarchy: a Java class suited for the creation and use of frame,

  2. guis.util.AmineFrame: An abstract class where the basic components of an Amine GUI frame are specified: menu Bar, tool Bar, and status Bar. MenuBar provides menus common to AmineFrame subclasses: File (New, Open, Save, etc.), Parameters (where some parameters are specified), Display (which provides the possibility to display Ontology and/or CG in specific forms), and Help (user manual and about). To an AmineFrame, we associate (as attribute), an ontology, a CGUIs/CGEditor, an AmineTextEditorUIs/AmineTextEditor, and a Debug Frame where different messages (Information, Warning, Error, etc.) are displayed about actions done in the context of the current Amine Frame (Figure 1),

  3. guis.util.OntologyBasedFrame: An abstract class that extends AmineFrame by adding a menu (called Ontology) for the Load/Close/Save of an ontology and for the activation of the LexiconsOntology GUI. OntologyBasedFrame is the root for GUIs that make use of ontology file(s) as secondary, i.e. the GUI is not dedicated to the edition of GUI but uses an ontology. This is the case of CGNotationsGUI and CGOperationsGUI and also for the forthcoming PrologPlusCGGUI.

  4. guis.util.OntologyLanguageFrame:  A class that extends OntologyBasedFrame by adding a menu (called Language) that enables the choice of a language among the languages of the current ontology. The selected language will be the current language. PrologPlusCGGUIFrame will be a subclass of this class.

  5. guis.cgNotationsGUI.CGFrame: A class that extends OntologyBasedFrame by the implementation of the File operations (New, Open, Save, etc.) on CG file(s).

  6. guis.lexiconsOntologyGUI.OntologyGUIFrame: The main frame for the Ontology GUI. OntologyGUIFrame extends AmineFrame by the implementation of the File operations (New, Open, Save, etc.) on Ontology file(s) and by offering specific functionalities. OntologyGUIFrame provides a tabbed pane composed of two panels: one for the creation and edition of the ontology and the second panel for types hierarchy operations. See LexiconsOntology GUI for more detail.

  7. guis.cgNotationsGUI.CGNotationsGUIFrame: It is a multi-documents, multi-lingua, and multi-notations CG Editors. It provides a CG Files tabbed pane (JTabbedPane Java class), one panel per CG file. For one CG file, it provides a tabbed pane (TbdPneLanguages), one panel per language of the ontology. For one CG file and one language, it provides a tabbed pane (TbdPneCGEditors), one panel per CG notation (LF, CGIF, Graphic). Thus, we have a nesting of three TabbedPane: each panel in the first tabbed pane (CG Files TabbedPane) corresponds to a tabbed pane for languages (a TbdPneLanguages), and each panel of TbdPneLanguages corresponds to a tabbed pane for CG notations editors (a TbdPneCGEditors). See CGNotations GUI for more detail.

  8. guis.cgOperationsGUI.CGOperationsGUIFrame: this frame contains two nested split-pane: the top pane is itself a split-pane for the edition of the two input CGs and the bottom pane is for the output CG. Buttons for CG operations are also specified in the bottom pane. The three panels for the three CGs correspond in fact to TbdPneLanguages. See CGOperations GUI for more detail.

  9. Prolog+CGGUIFrame: under construction.

  10. guis.util.CGUIs: UIs associated to CGEditor. These UIs concern CG parameters (functional CG, canonicity) and other facilities.

  11. guis.cgNotationsGUI.TbdPneLanguages: It extends JTabbedPane Java class, each panel in TbdPneLanguages corresponds to a language of the current ontology and contains a  TbdPneCGEditors (a tabbed pane that contains three panels for LF, CGIF, and graphic CG editors). It is important to note that the three panels of TbdPneCGEditors and all panels of a TbdPneLanguages concern ONE CG: one CG can be expressed in different languages, and for a language, a CG can be formulated in different notations. Of course, a change in one CG editor will be notified by all the other CG editors. That is why TbdPneLanguages has an attribute for the CG in edition.

  12. guis.cgNotationsGUI.TbdPneCGEditors: It extends JTabbedPane Java class, it contains three panels for the edition of the three CG notations (Linear Form, CGIF, and Graphic Form). The first two editors are instances of CGTextEditor. The third editor is under construction.

To complete our overview of GUIs packages and classes, Figure 2 shows organization of CGEditors and AmineEditors that are used in TbdPneCGEditors and elsewhere. See comments below.

Figure 2: Hierarchy of CGEditors and AmineEditors

Comments:

  1. guis.util.AmineEditor: This class is concerned by undo/redo operations and UndoManager.

  2. guis.util.AmineTextEditor and guis.util.AmineTextEditorUIs: AmineTextEditor extends AmineEditor with operations concerning text editor. The class is a text area manager ; it provides a text area (an instance of JTextArea Java class) and associate to this later the undo manager (undo, redo), edit operations (cut, copy, past), character operations (font, size), search operations (find, findNext, replace, replaceAll) and other classic operations (getText, setText, append). UIs (buttons and menu items) that are associated to these operations are grouped in AmineTextEditorUIs.

  3. guis.cgNotationsGUI.CGEditor: CGEditor is an abstract class that extends JPanel Java class. It contains attributes and methods that are common to the three types of CGEditors (LF editor, CGIF editor, and Graphic editor). In fact, a LF editor and a CGIF editor are both instances of CGTextEditor.

  4. guis.cgNotationsGUI.CGTextEditor: CGTextEditor incorporates an AmineTextEditor and provides specific implementation of CGEditor abstract methods: parse() which identifies the type of the CGTextEditor (LF or CGIF) and calls the appropriate method (CG.parseLF() or CG.parseCGIF()) for parsing the CG notation, and generate() which produces a textual formulation of the internal CG in LF or in CGIF according to the type of the current CGTextEditor.