GithubHelp home page GithubHelp logo

smmehrab / simple-gui-builder Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 263 KB

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

License: Apache License 2.0

Java 100.00%
abstract-factory-pattern adapter-pattern design-pattern gui-builder java-swing singleton-pattern

simple-gui-builder's Introduction

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.

simple-gui-builder's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.