Pretty Swing UI

You can run the WebStart application or, as usual, download its source code.

Simulation d'un Atelier de Production is an application I and some friends wrote for practical work at school. Since it has been mostly written in two nights, the result is not complete and lacks some polish. Basically this application is supposed to let you configure an assembly shop to run simulations on it. Unfortunately the implementation of our MVC took much longer than expected. We also struggled with JGraph since it was the first time we were using it. So we didn't had the time to finish it: features are missing and well, the UI is not perfect (especially the icons on the sidebar, poorly chosen :)

This is what you see when you launch the application:

This dialog lets you choose between the three modules of the application: workshop configuration, simulation and reporting. These big buttons are implemented in fr.insalyon.simulation.ihm.composant.Cartouche. They behave more or less like real buttons since you can set an icon, a label and action listeners. The header of this dialog is implemented in the same package, in the class PanneauAide. You can give its constructor an icon and three strings. Finally, the footer is implement in PanneauPied. Hence, it is easy to create other dialogs looking the same:

The workshop configuration module uses JGraph to display the shop assembly layout. It also uses the Drag With Style effect when you want to put a zone or a machine on the graph. Here is what it looks like:

To add a component simply drag it from the sidebar and drop it on the white area. There are some rules though. Machines, for instance, can be dropped only in a zone. You can also link the ports together. Drag the red exit port of a zone to the green enter port of another zone and see what happens. The cursor does not change as it should because of a bug introduced in the last hours of development.

Despite its defects (useless icons in the title bars, poor graphical metaphors in the sidebar, questionable color choices in the graph area…) this UI shows how elegant Swing can be, especially when using JGoodies Plastic look and feel. You can also note that the afore presented dialogs are sorely inspired by Karsten demos ;-)

P.S: if you want to read the code, you'd better revise your french :p

Comments are closed.