Changeset 9099 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2015-12-11T17:36:59+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 4 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); -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleKeys.java
r9005 r9099 11 11 String FILL_COLOR = "fill-color"; 12 12 String FILL_EXTENT = "fill-extent"; 13 String FILL_EXTENT_THRESHOLD = "fill-extent-threshold"; 13 14 String FILL_IMAGE = "fill-image"; 14 15 String FILL_OPACITY = "fill-opacity"; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r9087 r9099 633 633 return IN_DOWNLOADED_AREA.evaluate(e.osm); 634 634 } 635 636 static boolean completely_downloaded(Environment e) { 637 if (e.osm instanceof Relation) { 638 return !((Relation) e.osm).hasIncompleteMembers(); 639 } else { 640 return true; 641 } 642 } 643 644 static boolean closed2(Environment e) { 645 if (e.osm instanceof Way && ((Way) e.osm).isClosed()) 646 return true; 647 if (e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon()) 648 return MultipolygonCache.getInstance().get(Main.map.mapView, (Relation) e.osm).getOpenEnds().isEmpty(); 649 return false; 650 } 635 651 } 636 652 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r8874 r9099 204 204 | < ELEMENT_OF: "∈" > 205 205 | < CROSSING: "⧉" > 206 | < PERCENT: "%" > 206 207 | < COMMENT_START: "/*" > : COMMENT 207 208 | < UNEXPECTED_CHAR : ~[] > // avoid TokenMgrErrors because they are hard to recover from … … 1126 1127 } 1127 1128 { 1128 f=ufloat() ( u=ident() | <DEG> { u = "°"; } )1129 f=ufloat() ( u=ident() | <DEG> { u = "°"; } | <PERCENT> { u = "%"; } ) 1129 1130 { 1130 1131 Double m = unit_factor(u); … … 1143 1144 case "grad": return Math.PI / 200; 1144 1145 case "turn": return 2 * Math.PI; 1146 case "%": return 0.01; 1145 1147 case "px": return 1.; 1146 1148 case "cm": return 96/2.54;
Note:
See TracChangeset
for help on using the changeset viewer.