5.3 GUI


The graphical user interface for the refactoring tool is as important as the implementation of the transformation. A programmer has to understand how to refactor, otherwise he won't use the tool at all. DPT offers one main window with a small set of operations and a „Transformation-Assistant“ which is a part of each generator bean.

The main window shows the user the source-files included in the DPT project and the catalog of the transformations which can be applied to these source-files. In order to show the user the changes created by the transformation, a simple source-code browser is included in the main windows.


(Figure 5.10 GUI: DPT-Frame)


Like many software development tools, DPT works with projects. Each project manages the source-files for the transformation and a catalog of the transformations attached to this project.The project-properties can be set by the user by creation of the project via dialog-„New project“ and can be displayed via dialog-„Project Attribute“

(Menu: Main->Project->Attribute)


The attributes of the project are:

- Project name = Identifier for the project and for the project configuration file that will be created by DPT. This file contains the information about the project and will be used by loading the project from disk.

- The project directory path: This is the path to the DPT-directory for this project. For each project, DPT creates a directory with a working copy of the project source files and configuration files specific for this project.

Examples: „fat.ini“ = information about the project files and their original locations.

                  „history.ini“ = the history of the completed transformations for this project.

- Name of the transformation-catalog that is currently used by this project. The catalog contains the names of available transformations(=generator-beans) or compositions of these transformations(user defined transformations)


(Figure 5.11 DPT-Dialog „New Project“)


- File types and signatures. This attribute contains file-information and file-extension of the source-code and will be used for file-dialog (“Add/Remove“ file from the project) to select valid files.

- The project-language. This attribute will be used to select the correct parser and generators for the source-files.

The following operations are available in the main window for the manipulation of the project and project attributes.

Project manipulation:

(Figure: Menu - Project)


- Load project (Menu: Main->Project->Load or Toolbar-Icon)

  DPT keeps track of its projects and by load-operation, DPT offers a list of  the last   

  three projects. Also via dialog „Open project“ user can open an existing project.

  (The current project will be closed)

- Close project (Menu: Main->Project->close)

  As implied by its name, the current project will be closed. 

- Save  project (Menu: Main->Project->Save or Toolbar-Icon)

If project is new, an entry for this project will be created in the file of available projects.

- Create new project (Menu: Main->Project->New)

  via dialog: „New project“ user sets the attribute for the project. 


File manipulation:

(Figure: Menu - Files)

- Add files to the project:

By adding a file to the DPT-project, a copy of this file will be created in the working directory of the project, and the path of the original file location will be attached to the file-table of the project.


- Remove files from the project:

DPT does not delete the file at the original location. It only deletes it in the working directory and removes the file entry from the file-table of the project.


- Add file signatures:

The user can add file signatures to the project in order to add these files to the project.

A signature can be added via dialog „Attribute“ (Menu: Main->Project->Attribute).


- Update files:

The user may want to synchronize the source files with their original location. Especially if the source files were modified outside of the DPT-environment. This operation can be completed by action Menu: Main->Options->Synchronize.

Transformation-catalog manipulation:


(Figure: Menu - Catalog)


The project files are stored separately for each project. Contrary to project-files, catalogs and transformations are available for all projects and can be used by more then one project. This allows the user to be able to switch/change the transformation-catalog for a DPT-project.

Note: Catalogs „simple“, „standard“, „extended“ are default catalogs of the DPT.  They can't be modified directly. The user has to create a new catalog based on the default one.


(Figure 5.12 DPT-Dialog „New Catalog“)


- Create new catalog (Main->Catalog->New)

The user can create his own(favorite) catalog. The new catalog is a copy of the current project catalog and can be loaded and modified by the user.


- Load catalog (Main->Catalog->Load)

User can load an existing catalog to the project. The current project-catalog will be replaced by the new catalog.


- Save Catalog(Main->Catalog->Save)

After the changes to the current catalog(e.g. if new transformation was created) the user may want to save the new composition of the catalog.


- Add transformation to the catalog (Main->Catalog->AddToCatalog)

An existing transformation will be added to the current project-catalog.


- Remove transformation from the catalog (Main->Catalog->AddToCatalog)

A transformation will be removed from the current project-catalog.


Transformation manipulation:

(Figure: Menu - Transformation)


- Execution of the transformation: (Main->Transformation->Execute or Toolbar-Icon)

The user needs to select a transformation from the catalog-tree and then press Execute-button on the toolbar. DPT will load and execute the transformation-bean.


- Composition of the transformation: (Main->Transformation->New pattern)

The user may want to create his own transformation. Via dialog „Composite“ the user can create a new transformation as composition of the existing transformations.


- Load / Modify  transformation: (Main->Transformation->Load pattern)

An existing transformation can be loaded and modified by user. Via dialog „Composite“ user can browse and change the composition of the transformation.


- Save  transformation: (Main->Transformation->Save pattern)

As implied by its name, this action saves the transformation. 


Additional functionality:

In Menu „Options“ DPT offers additional features of the tool:


(Figure: Menu - Options)


- Undo/Redo of the transformation: (Main->Options->Undo/Redo)

Note: undo/redo works only for changes on existing files. If a file was created by the transformation, DPT wouldn’t be able to find the old version of the file.


- Files-synchronization: (Main->Options->Synchronize) is already described above.


- Update symbol-table: (Main->Options->Reparse)

DPT manages not only visible objects like the file-table or transformation catalog, it has also some hidden objects like a symbol-table and parsers that write the symbol table.

The user can force reparse the project files in order to update the symbol-table.


- Remove comments: (Main->Options->Remove comments)

An useful feature of DPT is the possibility to remove generated comments from the source-code. The user needs to select a file from the file-list before chooses this option.


- Show-menu: (Main->Show->...)


(Figure: Menu - Show)

Some more or less useful information like transformation-history, file-differences, file-table, symbol-table or project-file can be accessed in menu „Show“.


- Help-menu: (Main->Help->...)


(Figure: Menu - Help)


Contains help-information for DPT-tool and a Welcome-example.