Changeset 9099 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
- Timestamp:
- 2015-12-11T17:36:59+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
r9008 r9099 26 26 public TextElement text; 27 27 public Float extent; 28 public Float extentThreshold; 28 29 29 protected AreaElemStyle(Cascade c, Color color, MapImage fillImage, Float extent, TextElement text) { 30 protected AreaElemStyle(Cascade c, Color color, MapImage fillImage, Float extent, Float extentThreshold, TextElement text) { 30 31 super(c, 1f); 31 32 CheckParameterUtil.ensureParameterNotNull(color); 32 33 this.color = color; 34 this.fillImage = fillImage; 33 35 this.extent = extent; 34 this. fillImage = fillImage;36 this.extentThreshold = extentThreshold; 35 37 this.text = text; 36 38 } … … 39 41 final Cascade c = env.mc.getCascade(env.layer); 40 42 MapImage fillImage = null; 41 Color color = null; 42 Float extent = null; 43 Color color; 43 44 44 45 IconReference iconRef = c.get(FILL_IMAGE, null, IconReference.class); … … 81 82 } 82 83 83 extent = c.get(FILL_EXTENT, null, float.class); 84 Float extent = c.get(FILL_EXTENT, null, float.class); 85 Float extentThreshold = c.get(FILL_EXTENT_THRESHOLD, null, float.class); 84 86 85 87 if (color != null) 86 return new AreaElemStyle(c, color, fillImage, extent, text); 88 return new AreaElemStyle(c, color, fillImage, extent, extentThreshold, text); 87 89 else 88 90 return null; … … 101 103 } 102 104 } 103 painter.drawArea((Way) osm, myColor, fillImage, extent, painter.isInactiveMode() || osm.isDisabled(), text); 105 painter.drawArea((Way) osm, myColor, fillImage, extent, extentThreshold, painter.isInactiveMode() || osm.isDisabled(), text); 104 106 } else if (osm instanceof Relation) { 105 107 if (color != null && (selected || outermember)) { 106 108 myColor = paintSettings.getRelationSelectedColor(color.getAlpha()); 107 109 } 108 painter.drawArea((Relation) osm, myColor, fillImage, extent, painter.isInactiveMode() || osm.isDisabled(), text); 110 painter.drawArea((Relation) osm, myColor, fillImage, extent, extentThreshold, painter.isInactiveMode() || osm.isDisabled(), text); 109 111 } 110 112 } … … 124 126 if (extent != other.extent) 125 127 return false; 128 if (extentThreshold != other.extentThreshold) 129 return false; 126 130 if (!Objects.equals(text, other.text)) 127 131 return false; … … 134 138 hash = 61 * hash + color.hashCode(); 135 139 hash = 61 * hash + (extent != null ? Float.floatToIntBits(extent) : 0); 140 hash = 61 * hash + (extentThreshold != null ? Float.floatToIntBits(extent) : 0); 136 141 hash = 61 * hash + (fillImage != null ? fillImage.hashCode() : 0); 137 142 hash = 61 * hash + (text != null ? text.hashCode() : 0);
Note:
See TracChangeset
for help on using the changeset viewer.
