Changeset 11388 in josm
- Timestamp:
- 2016-12-13T12:30:54+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r10309 r11388 19 19 * Simple map of properties with dynamic typing. 20 20 */ 21 public final class Cascade implements Cloneable{22 23 private Map<String, Object> prop = new HashMap<>();21 public final class Cascade { 22 23 private final Map<String, Object> prop; 24 24 25 25 private boolean defaultSelectedHandling = true; 26 26 27 27 private static final Pattern HEX_COLOR_PATTERN = Pattern.compile("#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})"); 28 29 /** 30 * Constructs a new {@code Cascade}. 31 */ 32 public Cascade() { 33 this.prop = new HashMap<>(); 34 } 35 36 /** 37 * Constructs a new {@code Cascade} from existing one. 38 * @param other other Cascade 39 */ 40 public Cascade(Cascade other) { 41 this.prop = new HashMap<>(other.prop); 42 } 28 43 29 44 public <T> T get(String key, T def, Class<T> klass) { … … 196 211 197 212 @Override 198 public Cascade clone() {199 try {200 Cascade c = (Cascade) super.clone();201 @SuppressWarnings({ "unchecked", "rawtypes" })202 Map<String, Object> clonedProp = (Map<String, Object>) ((HashMap) this.prop).clone();203 c.prop = clonedProp;204 return c;205 } catch (CloneNotSupportedException e) {206 throw new IllegalStateException(e);207 }208 }209 210 @Override211 213 public String toString() { 212 214 StringBuilder res = new StringBuilder("Cascade{ "); -
trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java
r9239 r11388 39 39 if (c == null) { 40 40 if (layers.containsKey("*")) { 41 c = layers.get("*") .clone();41 c = new Cascade(layers.get("*")); 42 42 } else { 43 43 c = new Cascade();
Note:
See TracChangeset
for help on using the changeset viewer.