Changeset 6857 in josm for trunk


Ignore:
Timestamp:
2014-02-17T01:13:18+01:00 (11 years ago)
Author:
Don-vip
Message:

do not attempt to load Quaqua L&F on other platforms than Mac OSX

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r6764 r6857  
    1616import javax.swing.JScrollPane;
    1717import javax.swing.ListCellRenderer;
     18import javax.swing.LookAndFeel;
    1819import javax.swing.UIManager;
    1920import javax.swing.UIManager.LookAndFeelInfo;
     
    2930import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    3031import org.openstreetmap.josm.tools.GBC;
     32import org.openstreetmap.josm.tools.PlatformHookOsx;
    3133
    3234/**
     
    6163
    6264        // let's try to load additional LookAndFeels and put them into the list
    63         try {
    64             Class<?> Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");
    65             Object Oquaqua = Cquaqua.getConstructor((Class[])null).newInstance((Object[])null);
    66             // no exception? Then Go!
    67             lafCombo.addItem(
    68                     new UIManager.LookAndFeelInfo(((javax.swing.LookAndFeel)Oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")
    69             );
    70         } catch (Exception ex) {
    71             // just debug, Quaqua may not even be installed...
    72             Main.debug(ex.getMessage());
     65        if (Main.platform instanceof PlatformHookOsx) {
     66            try {
     67                Class<?> Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");
     68                Object Oquaqua = Cquaqua.getConstructor((Class[])null).newInstance((Object[])null);
     69                // no exception? Then Go!
     70                lafCombo.addItem(
     71                        new UIManager.LookAndFeelInfo(((LookAndFeel)Oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")
     72                );
     73            } catch (Exception ex) {
     74                // just debug, Quaqua may not even be installed...
     75                Main.debug(ex.getMessage());
     76            }
    7377        }
    7478
Note: See TracChangeset for help on using the changeset viewer.