X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FMainFrameApplication.java;h=461f9f3d4657154bba7efcd76d6f72cc5307a3a7;hb=0fd0a770a96b63d7aede3af5f1e47c29a85595c6;hp=7af0adc7016f10135bbb2cf5e443ccfe8565c2d4;hpb=2f2348de20c5db605c224b87dadd2e8c10f5d51d;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index 7af0adc..461f9f3 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -57,6 +57,7 @@ import javax.swing.WindowConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.filechooser.FileFilter; +import javax.swing.plaf.synth.SynthLookAndFeel; import org.forester.archaeopteryx.Options.CLADOGRAM_TYPE; import org.forester.archaeopteryx.Options.NODE_LABEL_DIRECTION; @@ -236,25 +237,42 @@ public final class MainFrameApplication extends MainFrame { throw new IllegalArgumentException( "configuration is null" ); } try { - if ( _configuration.isUseNativeUI() ) { - UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() ); + boolean synth_exception = false; + if ( Constants.__SYNTH_LF ) { + try { + final SynthLookAndFeel synth = new SynthLookAndFeel(); + synth.load( MainFrameApplication.class.getResourceAsStream( "/resources/synth_look_and_feel_1.xml" ), + MainFrameApplication.class ); + UIManager.setLookAndFeel( synth ); + } + catch ( Exception ex ) { + synth_exception = true; + ForesterUtil.printWarningMessage( Constants.PRG_NAME, + "could not create synth look and feel: " + + ex.getLocalizedMessage() ); + } } - else { - UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName() ); + if ( !Constants.__SYNTH_LF || synth_exception ) { + if ( _configuration.isUseNativeUI() ) { + UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() ); + } + else { + UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName() ); + } } //UIManager.setLookAndFeel( "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel" ); } catch ( final UnsupportedLookAndFeelException e ) { - Util.dieWithSystemError( "UnsupportedLookAndFeelException: " + e.toString() ); + Util.dieWithSystemError( "unsupported look and feel: " + e.toString() ); } catch ( final ClassNotFoundException e ) { - Util.dieWithSystemError( "ClassNotFoundException: " + e.toString() ); + Util.dieWithSystemError( "class not found exception: " + e.toString() ); } catch ( final InstantiationException e ) { - Util.dieWithSystemError( "InstantiationException: " + e.toString() ); + Util.dieWithSystemError( "instantiation exception: " + e.toString() ); } catch ( final IllegalAccessException e ) { - Util.dieWithSystemError( "IllegalAccessException: " + e.toString() ); + Util.dieWithSystemError( "illegal access exception: " + e.toString() ); } catch ( final Exception e ) { Util.dieWithSystemError( e.toString() );