-
Notifications
You must be signed in to change notification settings - Fork 797
AIMA3e GUI FX Framework
The GUI FX framework is part of the aima-gui subproject and consists of the package java.gui.fx and its subpackages. The aimax-osm subproject uses it for the FX versions of the map applications.
The framework provides demonstration applications for algorithms from the core project based on the JavaFX platform and supports the development of this kind of applications. Demo applications can be started as stand-alone applications and also within an integrated application. The first example shows an application which demonstrates how different CSP algorithms solve the N-Queens problem. It was started as stand-alone application.
The second example shows a frame integrating several applications and providing a menu to choose one of them. The currently selected application can be seen in the main pane, it is a map application which demonstrates how different search algorithms explore the state space for solving a routing problem.
The following UML diagram provides an overview about important classes and methods of the framework:
The abstract class IntegrableApplication provides a base class for all demo applications. Its start-method is in fact a template method and can be used as starter for all subclasses. Every concrete demo application class needs to specify a title, the content of its root pane, and methods for initialization and cleanup. This unified structure makes integration easy.
An integrated application can be created with very limited lines of code by means of a builder. The IntegratedAppBuilder class creates all the graphical menu Elements and the navigation logic. It just needs to know the classes of the applications to be integrated. See class aima.gui.fx.applications.InegratedAimaFxApp for an example.
In fact, the framework relies strongly on the GoF builder pattern. Instead of defining layouts by means of XML files explicitly, here, builders create large parts of the layout based an abstract specification of the content to be shown. To demonstrate, how algorithms do their work, it is often useful to slow down execution and show intermediate results during execution. It is also often useful, to compare example runes with different parameter settings. The SimulationPaneBuilder is specialized on this kind of applications. After being provided with parameter information, simulation and initialization methods, and with a pane for state visualization, builder constructs the complete layout of the application including toolbar and status bar and also the application logic. As usual in JavaFX, application logic is placed in so called controller classes which are here marked with class name ending Ctrl.