Skip to content

smmehrab/simple-gui-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple GUI Builder

Simple GUI Builder is a dummy project implemented using Java Swing Framework. The project is part of a lab assignment belonging to CSE-3216 (Software Design Patterns Lab).

The purpose of this project is to get a firm understanding over the following design patterns via implementing them:


Problem

The problem is to design a modern User Interface (UI) that supports multiple design styles (motif or ”look and feel”). The core of the UI is the single Window Manager (WM), which is responsible for the management of the UI items, such as buttons, text boxes and edit boxes. Different design styles are supported by the system: simplistic design style(for example, we can change the color of the elements), high detailed design style(for example, we can change the color and text size of the elements). WM should be initialized only by specifying the design style. Each UI item looks differently when the design style of the system is different. Also, each item has a value, which is displayed on the item itself (i.e. value of a button is the text displayed on the button).

The structure of a UI is described in a special config file. This file contains the structure of a UI

as a list of UI items, their values and their coordinates. Example of a config file:

Button, Click on me, X: 250, Y: 300

EditBox, Some text to edit, X: 250, Y: 350

A Config Manager class is responsible for loading config files. It has methods nextItem() - returns the next item in the list and hasMoreItems() - returns true if iterating through the list is not over yet. Window Manager has a method loadUI(ConfigManager config), which goes through the config step by step and displays all UI items.

To extend the functionality of the system, it must also be possible to load the configuration from an XML file. Your application should adapt one of the native java XML parsing methods (DOM

Parser/Builder, SAX Parser, Java XML I/O) and make it compatible with the ConfigManager interface. Example of an XML file:

<Button value=“Click on me” X=“250” Y=“300” />

<EditBox value=“Some text to edit” X=”250” Y=“350” />

...

Finally, to test the system, load UI elements from a config file, then from an XML file and then

create several items during the runtime programmatically.


Solution

The class diagram that's designed to solve the above problem, is given below:

Class Diagram

Note that, this is just a rough solution. I hope to further work on it later and modify it for better.

About

A simple GUI builder application implemented to showcase Adapter, Singleton and Abstract Factory Design Pattern in action.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages