1 7 8 package org.gjt.jclasslib.browser; 9 10 import javax.swing.*; 11 import java.beans.PropertyVetoException ; 12 import java.io.File ; 13 14 20 public class BrowserApplication { 21 22 25 public static final String APPLICATION_TITLE = "Bytecode viewer"; 26 29 public static final String SYSTEM_PROPERTY_LAF_DEFAULT = "jclasslib.laf.default"; 30 33 public static final String APPLICATION_VERSION = "3.0"; 34 37 public static final String WORKSPACE_FILE_SUFFIX = "jcw"; 38 39 private static BrowserMDIFrame frame; 40 41 47 public static void main(final String [] args) { 48 49 if (!Boolean.getBoolean(BrowserApplication.SYSTEM_PROPERTY_LAF_DEFAULT)) { 50 String lookAndFeelClass = UIManager.getSystemLookAndFeelClassName(); 51 try { 52 UIManager.setLookAndFeel(lookAndFeelClass); 53 } catch (Exception ex) { 54 } 55 } 56 57 frame = new BrowserMDIFrame(); 58 frame.setVisible(true); 59 60 if (args.length > 0) { 61 SwingUtilities.invokeLater(new Runnable () { 62 public void run() { 63 String fileName = args[0]; 64 File file = new File (fileName); 65 if (file.exists()) { 66 if (fileName.toLowerCase().endsWith("." + WORKSPACE_FILE_SUFFIX)) { 67 frame.openWorkspace(file); 68 } else if (fileName.toLowerCase().endsWith(".class")) { 69 BrowserInternalFrame internalFrame = frame.openClassFromFile(file); 70 try { 71 internalFrame.setMaximum(true); 72 } catch (PropertyVetoException e) { 73 } 74 } 75 } 76 } 77 }); 78 } 79 } 80 81 82 } 83 | Popular Tags |