String dir = System.getProperty("VDCT_DIR");
final String dir = System.getProperty("VDCT_DIR");
public static void main(java.lang.String[] args) {	try {		System.out.println("Loading VisualDCT v"+Version.VERSION+" build "+Version.BUILD+"...\n");				String javaVersion = (String)System.getProperties().get("java.version");		if (javaVersion!=null && javaVersion.compareTo(Version.JAVA_VERSION_REQUIRED) == -1)			System.out.println("WARNING: Java "+javaVersion+" detected. VisualDCT requires Java "+Version.JAVA_VERSION_REQUIRED+" or newer!\n");		/* Set default directory */		String dir = System.getProperty("VDCT_DIR");		if (dir!=null && new java.io.File(dir).exists())			Settings.setDefaultDir(dir);		else			Settings.setDefaultDir(".");		/* Set native look and feel */		// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());				/* Calculate the screen size */		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();		/* Create the splash screen */		VisualDCTSplashScreen aVisualDCTSplashScreen = new VisualDCTSplashScreen();		aVisualDCTSplashScreen.pack();		/* Center splash screen */		Dimension splashScreenSize = aVisualDCTSplashScreen.getSize();		if (splashScreenSize.height > screenSize.height)				splashScreenSize.height = screenSize.height;		if (splashScreenSize.width > screenSize.width)				splashScreenSize.width = screenSize.width;		aVisualDCTSplashScreen.setLocation((screenSize.width - splashScreenSize.width) / 2, (screenSize.height - splashScreenSize.height) / 2);		aVisualDCTSplashScreen.setVisible(true);				/* Create the frame */		final VisualDCT aVisualDCT = new VisualDCT();		aVisualDCT.setSize(Constants.VDCT_WIDTH, Constants.VDCT_HEIGHT);		aVisualDCT.getworkspace();		/* Dispose splash screen */		aVisualDCTSplashScreen.dispose();		/* Set default directory (for GUI !!! to be cleaned, use Setting singleton) */		if (dir!=null) aVisualDCT.setDefaultDirectory(dir);		else aVisualDCT.setDefaultDirectory(".");		// current dir				/* Parameters */		ConsoleInterface console = Console.getInstance();		console.silent("Loading VisualDCT v"+Version.VERSION+" build "+Version.BUILD+"...\n");		/* Recent files */		Settings.getInstance().loadRecentFiles();		/* Plugins */		com.cosylab.vdct.plugin.PluginManager.getInstance().checkAutoStartPlugins();			System.out.println();					if (args.length==0) {			System.out.println("\no) Usage: java "+VisualDCT.class.getName()+" [<DBDs>] [<DB>]\n");			aVisualDCT.openDBD(null, true);					// bring up a file dialog		}		else {			for (int i=0; i < args.length; i++)				if (args[i].toUpperCase().endsWith("DBD"))				{					System.out.println("Directive to load DBD: '"+args[i]+"'.");					aVisualDCT.openDBD(args[i]);				}			// only one DB			if (!args[args.length-1].toUpperCase().endsWith("DBD"))			{				System.out.println("Directive to load DB: '"+args[args.length-1]+"'.");				aVisualDCT.openDB(args[args.length-1]);			}		}				if (DataProvider.getInstance().getDbdDB()==null) {			System.out.println("No DBD loaded! Exiting...");			com.cosylab.vdct.plugin.PluginManager.getInstance().destroyAllPlugins();			System.exit(1);		}		/* Center frame on the screen */		Dimension frameSize = aVisualDCT.getSize();		if (frameSize.height > screenSize.height)				frameSize.height = screenSize.height;		if (frameSize.width > screenSize.width)				frameSize.width = screenSize.width;		aVisualDCT.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);		/* Add a windowListener for the windowClosedEvent */		aVisualDCT.addWindowListener(new java.awt.event.WindowAdapter() {			public void windowClosing(java.awt.event.WindowEvent e) {				aVisualDCT.exitMenuItem_ActionPerformed();			};			public void windowClosed(java.awt.event.WindowEvent e) {				Settings.getInstance().save();				com.cosylab.vdct.plugin.PluginManager.getInstance().save();				com.cosylab.vdct.plugin.PluginManager.getInstance().destroyAllPlugins();				System.out.println();				System.out.println("VisualDCT exited.");				System.exit(0);			};		});		aVisualDCT.setVisible(true);	} catch (Throwable exception) {		System.err.println("Exception occurred in main() of VisualDCT");		exception.printStackTrace(System.out);	}}