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=4ef0472a959c961cc81c8f74dea4f57d25e3f6dd;hpb=605b9b5326538a70a7afe353368b206516292575;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index 4ef0472..461f9f3 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -44,7 +44,6 @@ import java.util.List; import java.util.Set; import javax.swing.ButtonGroup; -import javax.swing.Icon; import javax.swing.JCheckBoxMenuItem; import javax.swing.JFileChooser; import javax.swing.JMenu; @@ -58,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; @@ -188,7 +188,6 @@ public final class MainFrameApplication extends MainFrame { private final static SequencesFileFilter seqsfilter = new SequencesFileFilter(); private final static DefaultFilter defaultfilter = new DefaultFilter(); private static final long serialVersionUID = -799735726778865234L; - private final JFileChooser _values_filechooser; private final JFileChooser _open_filechooser; private final JFileChooser _msa_filechooser; @@ -238,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() ); @@ -687,7 +703,7 @@ public final class MainFrameApplication extends MainFrame { @Override public void stateChanged( final ChangeEvent e ) { - MainFrame.setOvPlacementColorChooseMenuItem( _overview_placment_mi, getCurrentTreePanel() ); + MainFrame.setOvPlacementColorChooseMenuItem( _overview_placment_mi, getOptions() ); MainFrame.setTextColorChooseMenuItem( _switch_colors_mi, getCurrentTreePanel() ); MainFrame .setTextMinSupportMenuItem( _choose_minimal_confidence_mi, getOptions(), getCurrentTreePanel() ); @@ -702,6 +718,9 @@ public final class MainFrameApplication extends MainFrame { _uniform_cladograms_rbmi, _ext_node_dependent_cladogram_rbmi, _label_direction_cbmi ); + MainFrame.setCycleNodeFillMenuItem( _cycle_node_fill_mi, getOptions() ); + MainFrame.setCycleNodeShapeMenuItem( _cycle_node_shape_mi, getOptions() ); + MainFrame.setTextNodeSizeMenuItem( _choose_node_size_mi, getOptions() ); } } ); _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( DISPLAY_SUBHEADER ), getConfiguration() ) ); @@ -713,17 +732,12 @@ public final class MainFrameApplication extends MainFrame { _radio_group_1.add( _ext_node_dependent_cladogram_rbmi ); _radio_group_1.add( _uniform_cladograms_rbmi ); _radio_group_1.add( _non_lined_up_cladograms_rbmi ); - - // _options_jmenu.add( _show_default_node_shapes_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL ) ); - - - _options_jmenu.add( _taxonomy_colorize_node_shapes_cbmi = new JCheckBoxMenuItem( MainFrame.TAXONOMY_COLORIZE_NODE_SHAPES_LABEL) ); - _options_jmenu.add( _cycle_node_shape_mi = new JMenuItem( MainFrame.CYCLE_NODE_SHAPE_LABEL)); - _options_jmenu.add( _cycle_node_fill_mi = new JMenuItem( MainFrame.CYCLE_NODE_FILL_LABEL )); - _options_jmenu.add( _choose_node_size_mi = new JMenuItem( MainFrame.CHOOSE_NODE_SIZE_LABEL )); - // - + _options_jmenu + .add( _taxonomy_colorize_node_shapes_cbmi = new JCheckBoxMenuItem( MainFrame.TAXONOMY_COLORIZE_NODE_SHAPES_LABEL ) ); + _options_jmenu.add( _cycle_node_shape_mi = new JMenuItem( MainFrame.CYCLE_NODE_SHAPE_LABEL ) ); + _options_jmenu.add( _cycle_node_fill_mi = new JMenuItem( MainFrame.CYCLE_NODE_FILL_LABEL ) ); + _options_jmenu.add( _choose_node_size_mi = new JMenuItem( MainFrame.CHOOSE_NODE_SIZE_LABEL ) ); _options_jmenu.add( _show_scale_cbmi = new JCheckBoxMenuItem( DISPLAY_SCALE_LABEL ) ); _options_jmenu .add( _show_branch_length_values_cbmi = new JCheckBoxMenuItem( DISPLAY_BRANCH_LENGTH_VALUES_LABEL ) ); @@ -774,13 +788,11 @@ public final class MainFrameApplication extends MainFrame { customizeJMenuItem( _print_size_mi ); customizeJMenuItem( _choose_pdf_width_mi ); customizeJMenuItem( _overview_placment_mi ); - //TODO FIXME ~~ customizeCheckBoxMenuItem( _show_default_node_shapes_cbmi, getOptions().isShowDefaultNodeShapes() ); customizeCheckBoxMenuItem( _taxonomy_colorize_node_shapes_cbmi, getOptions().isTaxonomyColorizeNodeShapes() ); customizeJMenuItem( _cycle_node_shape_mi ); customizeJMenuItem( _cycle_node_fill_mi ); customizeJMenuItem( _choose_node_size_mi ); - //TODO FIXME ~~ customizeCheckBoxMenuItem( _color_labels_same_as_parent_branch, getOptions().isColorLabelsSameAsParentBranch() ); customizeCheckBoxMenuItem( _screen_antialias_cbmi, getOptions().isAntialiasScreen() ); customizeCheckBoxMenuItem( _background_gradient_cbmi, getOptions().isBackgroundColorGradient() );