AITEC Contract Research Projects in FY1997:Intermediate Report

(22) GUIdeLA: A Constraint Language and System for Constructing Graphical User Interfaces

Principal Investigator : Dr. Neng-Fa Zhou, Associate Professor
Faculty of Computer Science and Systems Engineering,
Kyusyu Institute of Technology


Title of the Research Project, Principal Investigator
(1) Title of the Research Project
GUIdeLA: A Constraint Language and System for Constructing Graphical User Interfaces

(2) Principal Investigator
Dr. Neng-Fa Zhou, Associate Professor,
Faculty of Computer Science and Systems Engineering, Kyusyu Institute of Technology

Contents
(1)Current progress of the project

Building some Graphical User Interfaces (GUI) by using Java is difficult and time-consuming. It is not easy to choose an appropriate layout manager for a GUI from five ayout managers available in Java, and sometimes, to draw graphical components one has to determine the sizes and positions of the components. To reduce the burden of the users, we designed a new language, called DJ (Declarative Java), in which one is required to specify only the components that compose a GUI and the relationships among the components by using constraints.
Basically, the users do not need to specify the layout managers and the geometric attribute values of the components. All these tasks are done by the compiler.

DJ is a Java-like object-oriented language, but offers more facilities for specifying GUIs. A DJ program consists of several classes and optionally several constraint definitions. The body of each class is a sequence of class member declarations. Besides FieldDeclaration and MethodDeclaration in a Java class, a class member declaration in a DJ class may also be one of the following: ComponentDeclaration, AttributeDeclaration, ConstraintDeclaration, and ActionDeclaration.

DJ can serve as not only a tool for building graphical user interfaces but also as a tool for solving general constraint satisfaction problems. This is because the constraint solver can determine not only the geometric layout of graphical components, but also the values to be displayed.

(2)Obtained research results

We have finished the design of DJ and the compilation algorithms, and is now implementing a compiler that compiles DJ programs into Java. DJ programs are compiled as follows: The built-in tokenizer of Java is used to extract tokens from programs. The tokens are passed to a parser written in DCG which reports syntax and semantic errors, and builds a parse tree. The parse tree contains all the information in the source program. The tree is passed to an extractor that extracts a constraint program that can be executed by B-Prolog.
The parse tree together with the solution from the constraint program are passed to a generator that generates a Java program.

To test the design, we have written several applications of DJ, including a program for drawing various kinds of trees and programs for solving general constraint satisfaction problems and displaying the solutions graphically.
To test the compilation algorithms, we have also compiled several programs into Java by hand.

(3)Planned schedule till the end of February 1998

While we are implementing the compiler, we are also writing more applications such that problems in the design can be exposed early and the compiler can be tested as early as possible. We plan to finish the compiler by the end of January. After that we plan to write more applications.

(4)Expected software by the end of February 1998

We believe that the functionality of DJ is of great interest to a wide range of users. However, a software cannot become popular just because of its functionality. We have to make great efforts to make it robust and user-friendly.

As a programming language, DJ is very simple. After learning the basic classes of graphical objects that are already available, one is able to define easily new classes of graphical objects by specifying attributes, components, constraints, and actions associated with the classes. The development environment is simple too.
The system provides only one command, called dj.
To run a program stored in a file, just type "dj file-name". The system opens a window in which the solution is displayed. Besides the solution, there are some menus and buttons through which the user can control the execution of programs. We will not have time to implement a debugging tool for DJ, but we will try to have the compiler display user-friendly error messages.


www-admin@icot.or.jp