JMCS (Java Mariotti Common Software) is a collection of APIs and jar files shared by all JMMC Java GUI applications (
SearchCal,
ModelFitting, ...).
Its goal is to centralize all shared functionalities (e.g menubar handling, about box window, ...) in order to provide our final users with more consistent, feature-reach, desktop-class applications across all 3 main execution platforms that are Linux, Mac OS X and Windows.
Its
DOXYGEN documentation
is also available for implementation details.
This page lists and describes each JMCS main functionalities:
App : the main class from which JMCS-based applications all derive
This class aim is to handle applications life cycle, normalized in 3 steps : intialization, execution and destruction.
For your application to benefit from JMCS, your main class shall derive from the App class, and thus implement each of its abstract methods :
init()
and
execute()
:
- Your
init()
method shall contain all your application initialization code, like specific command-line option parsing, MVC objects allocation and initialization, GUI setup, ...
- Your
exec()
method shall contain no code at all in fact, as long as your application GUI fully implement the reflex approach (e.g Observer/Observable and MVC patterns, ...) and has already been initialized in init()
.
- Furthermore, you can also provide your own
finnish()
method
to appropriately handle your application life cycle end.
When instantiated at execution in your main() method, your App-derived class will automatically bring your application to life by:
- Initializing App internal mecanisms (ApplicationData.xml file parsing, shared logger setup, command line option parsing, shared functionalities setup) when calling
super(...)
.
- Displaying a Splash screen (for at least 2 seconds), in order to let the end user know which application is about to start.
- Calling your
init()
method to fully setup your application GUI.
- Discarding the Splash screen, in order to let your GUI as the frontmost window.
- Calling your
exec()
method at last.
Here is a minimal JMCS-compliant application template
import fr.jmmc.mcs.gui.*;
public class Main extends App {
public Main(String[] args) {
super(args);
}
protected void init(String[] args) {
// Add your application initialization code here...
}
protected void execute() {
// Add your application execution code here...
}
public static void main(String[] args) {
new Main(args);
}
}
Application data : how they are stored and used
Splash screen : the window automatically shown while applications launch
About box : the window giving application detailled information to end user
Menu bar : default handled menu items and how to provide application specific ones
Preferences : standardized preference file location and version handling
Help : how to harness the shared LATEX-based help browser
Feedback report : how bug and user remarks are routed bak to the JMMC team
Logging facilities : how you should handle execution traces in your application
Here is the code you should add to each of your classes to use
standard java logging facilities
.
import java.util.logging.*;
public class Complex {
/** Logger */
private static final Logger _logger = Logger.getLogger(Complex.class.getName());
...
}
Relase notes : how they are automatically generated
Acknowledgement : how to provide a specific one for each application
Application website : where are applications main webpage and FAQ
Shared libraries : list of available third party toolkits
--
SylvainLafrasse - 30 Oct 2008