package birchprops; import java.io.File; import java.awt.Toolkit; import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.awt.Dimension; /** *

Title: BIRCH Properties Tool

* *

Description: GUI for modifying BIRCH properties

* *

Copyright: Copyright (c) 2016

* *

Company: University of Manitoba

* * @author Dr. Brian Fristensky * @version 1.0 */ public class BirchProps { boolean packFrame = false; BirchProperties BP = new BirchProperties(); /** * Construct and show the application. */ public BirchProps() { // Write startup messages to console System.out.println("------------------------- birchprops ------------------------------"); System.out.println("Userid: " + System.getProperty("user.name")); System.out.println("Current working directory: "+ System.getProperty("user.dir")); MainFrame frame = new MainFrame(BP); // Validate frames that have preset sizes // Pack frames that have useful preferred size info, e.g. from their layout if (packFrame) { frame.pack(); } else { frame.validate(); } // Center the window Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = frame.getSize(); if (frameSize.height > screenSize.height) { frameSize.height = screenSize.height; } if (frameSize.width > screenSize.width) { frameSize.width = screenSize.width; } frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); frame.setVisible(true); try { jbInit(); } catch (Exception ex) { ex.printStackTrace(); } System.out.flush(); } /** * Application entry point. * * @param args String[] /** * Application entry point. * * @param args String[] */ public static void main(String[] args) { // BirchProps MUST run in $BIRCH/install-scripts // The code below SHOULD work but for some reason, // customdoc can't find its files. Calling this jar from a // wrapper script, that first cd's to $BIRCH/install-scripts, is necessary. String BIRCHDIR = System.getenv("BIRCH"); String WDIR = BIRCHDIR + File.separator + "install-scripts"; System.setProperty("user.dir",WDIR); SwingUtilities.invokeLater(new Runnable() { public void run() { try { UIManager.setLookAndFeel(UIManager. getSystemLookAndFeelClassName()); } catch (Exception exception) { exception.printStackTrace(); } new BirchProps(); } }); } private void jbInit() throws Exception { } }