/** * The main method. * * @param args the arguments */ // for testing only public static void main(String args[]) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { // do nothing } catch (InstantiationException e) { // do nothing } catch (IllegalAccessException e) { // do nothing } catch (UnsupportedLookAndFeelException e) { // do nothing } theGUI = new GUI(null); }
/** * Sets the. * * @param gui the gui */ static void set(GUI gui) { prefs.putInt("WindowPos X", gui.getLocation().x); prefs.putInt("WindowPos Y", gui.getLocation().y); prefs.putInt("WindowH", gui.getHeight()); prefs.putInt("WindowW", gui.getWidth()); prefs.put("outDir", gui.pnG.tfOutDirName.getText()); prefs.put("inFile", gui.pnG.tfInputFileName.getText()); }
/** * Gets the. * * @param gui the gui */ static void get(GUI gui) { gui.setBounds(prefs.getInt("WindowPos X", 200), prefs.getInt("WindowPos Y", 200), prefs.getInt( "WindowW", 520), prefs.getInt("WindowH", 400)); gui.pnG.tfOutDirName.setText(prefs.get("outDir", "/temp")); String userDir = System.getProperty("user.dir").replaceAll("\\\\", "/"); gui.pnG.tfInputFileName.setText(prefs.get("inFile", userDir + "/examples/descriptors/tutorial/ex1/TutorialTypeSystem.xml")); } }
setDefaultCloseOperation(EXIT_ON_CLOSE); this.setIconImage(Images.getImage(Images.MICROSCOPE)); } catch (IOException e) { System.err.println("Image could not be loaded: " + e.getMessage()); this.getContentPane().setBackground(Color.WHITE); this.getContentPane().setLayout(new BorderLayout()); this.getContentPane().add(banner, BorderLayout.NORTH); this.getContentPane().add(pnG, BorderLayout.CENTER); setJMenuBar(createMenuBar()); pack();
/** * Drive gui. */ // ************ public void driveGui() { // usingGui = true; try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { System.err.println("Could not set look and feel: " + e.getMessage()); } gui = new GUI(this); gui.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { Prefs.set(gui); waiter.finished(); } }); Prefs.get(gui); gui.pnG.taStatus.setLineWrap(true); gui.pnG.taStatus.setWrapStyleWord(true); gui.show(); waiter = new Waiter(); waiter.waitforGUI(); }
/** * Show in status. * * @param message the message * @return the string */ String showInStatus(String message) { taStatus.setText(taStatus.getText() + message + NL); areaScrollPane.getVerticalScrollBar().setValue( areaScrollPane.getVerticalScrollBar().getMaximum()); gui.repaint(); return message; } }