if (g.error()) { // Any bad command line argument?
usage(null); // If so, whine and exit
}
// Get user's preferences, if any.
Preferences prefs = Preferences.userRoot().node("/jimm/datavision");
// Set look & feel.
try {
javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
// Default L&F will be used if any problems occur, most probably,
// ClassNotFound.
}
DataVision dv = new DataVision();
// Language
if (g.hasOption('g') || g.hasOption('i'))
I18N.setLanguage(new Locale(g.option('g', "").toLowerCase(),
g.option('i', "").toUpperCase()));
dv.layoutEngineChoiceFromOptions(g);
dv.dataSourceFromOptions(g);
if (dv.hasLayoutEngine()) {
if (dv.usesGUI()) // Can ask for password via GUI
ErrorHandler.useGUI(true);
else if (!g.hasOption('n') && !g.hasOption('p') && !g.hasOption('e'))
usage(I18N.get("DataVision.n_or_p"));
}
dv.paramXMLFile = g.option('r', null); // Parameter XML file name or null
dv.reportDir = g.option('R', null); // Report Directory or null
dv.outputDir = g.option('o', null); // Output Directory or null
// Store the report directory in the preferences for this package
// These values are stored in the root package jimm.datavision
if (dv.reportDir != null) {
prefs.put("reportDir",dv.reportDir);
}
if (dv.outputDir != null) {
prefs.put("outputDir",dv.outputDir);
}
if (g.argc() == 0) {
if (startupDialog()) // Returns true if we should exit
return;