Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/preferences/NamedColorProperty.java
r17118 r17119 5 5 import java.util.Arrays; 6 6 import java.util.List; 7 8 import javax.swing.UIManager; 7 9 8 10 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 30 32 /** 31 33 * Construct a new {@code NamedColorProperty}. 34 * 35 * The priority for getting the color is: 1. a set property, 2. {@link UIManager#getColor}, 3. the given {@code defaultValue} 32 36 * @param category a category, can be any identifier, but the following values are recognized by 33 37 * the GUI preferences: {@link #COLOR_CATEGORY_GENERAL} and {@link #COLOR_CATEGORY_MAPPAINT} -
trunk/test/unit/org/openstreetmap/josm/data/preferences/NamedColorPropertyTest.java
r14149 r17119 7 7 import java.awt.Color; 8 8 import java.util.Arrays; 9 import java.util.Collections; 10 11 import javax.swing.UIManager; 9 12 10 13 import org.junit.Before; … … 43 46 @Test 44 47 public void testGet() { 48 assertEquals(Color.RED, base.get()); 49 50 UIManager.put("JOSM.clr.general.test", Color.GRAY); 51 base = new NamedColorProperty("test", Color.RED); 52 assertEquals(Color.GRAY, base.get()); 53 54 Config.getPref().putList("clr.general.test", Collections.singletonList("#123456")); 55 assertEquals(new Color(0x123456), base.get()); 56 57 Config.getPref().putList("clr.general.test", null); 58 UIManager.put("JOSM.clr.general.test", null); 59 base = new NamedColorProperty("test", Color.RED); 45 60 assertEquals(Color.RED, base.get()); 46 61 }
Note:
See TracChangeset
for help on using the changeset viewer.