Instance explanation - XML framework for developing Swing programs
Introduction
Now, the market is tightening. The frame can save the design and development phase. IDE can make us more easily develop user interfaces. Standard GUI applications define the GUI in different panel layouts, which has become a fundamental mode. Based on this mode, consider using the framework to improve the execution speed, achieve higher parallel processing level, and coordinate more relaxed development methods. We are here to use the Java Swing application to describe such a framework. Simple Application - Library Management System Let's discuss a simple library management system to understand the XML-based GUI framework. The above flowchart defines the design of the library user interface. Main directory, member login, user registration, and book retrieval, these are panels existing in the application. As can be seen from the flow chart, there may be the following: Main directory -> User Registration -> Book Retriever -> Book Retrieval
in principle
The panel displayed at any time relies on the output of the first front panel. Therefore, it is necessary to design a normal controller as a form of the entire frame, which provides the panel for the necessary input, and handles the output content returned to the panel. These panels have implemented XsfPanel interfaces that have an execute () method to store the input content in the form into a HashMap and return output content from another HashMap. The controller of the framework handles the output content returned using HashMap and determines which panel that should be displayed at any time.
Public Interface Xsfpanel Extends JPanel {Public HashMap Execute (HashMap INPUTS) ;..
Controller and XML flow definition
Stream controller and a simple definition of XML associated with the user interface. This XML must be defined based on the contents of each panel input and description will output. This simple program we discussed here is based on the following XML work.
Xfspanels>
Xfsframework>
Note: This XML is only used to describe the framework.
In the above XML, all panels that implement the XFsparel interface are mentioned. The stream information from a panel to another panel.
Translated by caiyi0903 (Willpower), 2004.5.23