/*========================================================================= Program: FusionViewer Module: $RCSfile: ViewerMain.java,v $ Language: Java Date: $Date: 2008/01/11 21:43:26 $ Version: $Revision: 1.5 $ Copyright (c) Insightful Corporation. All rights reserved. See Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ package org.fusionviewer.ui; import java.awt.Toolkit; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.SwingUtilities; import javax.swing.UIManager; import org.fusionviewer.io.Env; /**\class ViewerMain *\brief Main class for FusionViewer. */ public class ViewerMain { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { try { if (Env.isWindows) { UIManager.setLookAndFeel(new com.sun.java.swing.plaf.windows.WindowsLookAndFeel()); } else if (Env.isMac) { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); // Set menubar for Mac OS X System.setProperty("apple.laf.useScreenMenuBar", "true"); System.setProperty("com.apple.macos.smallTabs", "true"); System.setProperty("ATI_WORKAROUND", "false"); } if (System.getProperty("os.name").toLowerCase().startsWith("linux")) { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } } catch (Throwable e) { } Toolkit.getDefaultToolkit().setDynamicLayout(false); JFrame panel = new ImageViewFrame(); panel.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //customize the application icon java.net.URL imageURL = ViewerMain.class.getResource("images/FusionViewer_logo.png"); panel.setIconImage(new ImageIcon(imageURL).getImage()); } }); } }