Logo Search packages:      
Sourcecode: pauker version File versions  Download package

static void pauker::program::gui::swing::PaukerFrame::main ( final String  args[]  )  [inline, static]

Parameters:
args the command line arguments

Definition at line 3630 of file PaukerFrame.java.

References openFiles(), PaukerFrame(), and STRINGS.

                                                 {

//        Properties properties = System.getProperties();
//        Enumeration propertyNames = properties.propertyNames();
//        while (propertyNames.hasMoreElements()) {
//            String key = (String) propertyNames.nextElement();
//            String property = properties.getProperty(key);
//            System.out.println(key + ':' + property);
//        }

        // check java version
        String javaVendor = System.getProperty("java.vendor");
        String javaVersion = System.getProperty("java.version");
        String[] tokens = javaVersion.split("\\.");
        int majorVersion = Integer.parseInt(tokens[0]);
        int minorVersion = Integer.parseInt(tokens[1]);
        if (majorVersion <= 1 && minorVersion <= 4) {
            logger.severe(
                    "***************************************************\n" +
                    STRINGS.getString("Error_Java_Version") + "\n" +
                    "***************************************************");
            System.exit(-1);
        }

        // gather language info
        String userLanguage = System.getProperty("user.language");
        String userCountry = System.getProperty("user.country");

        // check heap size
        Runtime runtime = Runtime.getRuntime();
        long maxMemory = runtime.maxMemory();

        // OS specific handling
        String osName = System.getProperty("os.name");

        // log all collected info
        NumberFormat format = NumberFormat.getIntegerInstance();
        logger.info("\n " +
                STRINGS.getString("Operating_System") +
                ": \"" + osName + "\"\n " +
                STRINGS.getString("Java_Vendor") +
                ": \"" + javaVendor + "\"\n " +
                STRINGS.getString("Java_Version") +
                ": \"" + javaVersion + "\"\n " +
                STRINGS.getString("User_Language") +
                ": \"" + userLanguage + "\"\n " +
                STRINGS.getString("User_Country") +
                ": \"" + userCountry + "\"\n " +
                STRINGS.getString("Maximum_Memory") +
                ": " + format.format(maxMemory) + " byte\n");

        // show warning when heap is too small
        if (maxMemory < 100000000) {
            logger.warning(STRINGS.getString("Warning_Small_Heap"));
        }

        // special handling for Mac OS X
        if ("Mac OS X".equals(osName)) {
            logger.info("using Mac OS X screen menu bar...");
            System.setProperty("apple.laf.useScreenMenuBar", "true");
        }

        // WORKAROUND:
        // The the Java Runtime provides localization only for some languages.
        // So we provide a way here to localize the missing languages...
        String language = Locale.getDefault().getLanguage();
        if ("nl".equals(language) || "eo".equals(language) ||
                "pl".equals(language)) {
            translateUI("FileChooser.detailsViewButtonToolTipText");
            translateUI("FileChooser.fileNameLabelText");
            translateUI("FileChooser.filesOfTypeLabelText");
            translateUI("FileChooser.homeFolderToolTipText");
            translateUI("FileChooser.listViewButtonToolTipText");
            translateUI("FileChooser.lookInLabelText");
            translateUI("FileChooser.newFolderToolTipText");
            translateUI("FileChooser.upFolderToolTipText");
        }

        // tell the UIManager to use the platform look & feel
//        try {
//            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
//        } catch (Exception e) {
//        // ignored...
//        }

        // start up
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                PaukerFrame paukerFrame = new PaukerFrame();
                paukerFrame.setVisible(true);
                if (args.length > 0) {
                    String path = args[0];
                    // support for Java Web Start arguments
                    if (args[0].equals("-open") && args.length > 1) {
                        path = args[1];
                    }
                    File file = new File(path);
                    paukerFrame.openFiles(new File[]{file}, null, false);
                }
            }
        });
    }


Generated by  Doxygen 1.6.0   Back to index