Ignore:
Timestamp:
2016-02-11T23:37:07+01:00 (8 years ago)
Author:
bastiK
Message:

new mappaint performance test
tests different features separately

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSetting.java

    r8674 r9786  
    6060                @Override
    6161                public void actionPerformed(ActionEvent e) {
    62                     boolean b = item.isSelected();
    63                     if (b == def) {
    64                         Main.pref.put(prefKey, null);
    65                     } else {
    66                         Main.pref.put(prefKey, b);
    67                     }
     62                    setValue(item.isSelected());
    6863                    Main.worker.submit(new MapPaintStyles.MapPaintStyleLoader(Arrays.asList(parentStyle)));
    6964                }
     
    9590            return Boolean.valueOf(val);
    9691        }
     92
     93        public void setValue(Object o) {
     94            if (o == null || !(o instanceof Boolean)) {
     95                throw new IllegalArgumentException();
     96            }
     97            boolean b = (Boolean) o;
     98            if (b == def) {
     99                Main.pref.put(prefKey, null);
     100            } else {
     101                Main.pref.put(prefKey, b);
     102            }
     103        }
    97104    }
    98105}
Note: See TracChangeset for help on using the changeset viewer.