Changeset 9341 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement
- Timestamp:
- 2016-01-07T18:13:44+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java
r9323 r9341 138 138 @Override 139 139 public int hashCode() { 140 int hash = 3;140 int hash = super.hashCode(); 141 141 hash = 61 * hash + color.hashCode(); 142 142 hash = 61 * hash + (extent != null ? Float.floatToIntBits(extent) : 0); -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java
r9278 r9341 32 32 c.put(Z_INDEX, -3f); 33 33 } 34 return createLine(new Environment(null, mc, "default", null)); 34 Way w = new Way(); 35 return createLine(new Environment(w, mc, "default", null)); 35 36 } 36 37 … … 42 43 public float offset; 43 44 public float realWidth; // the real width of this line in meter 45 public boolean wayDirectionArrows; 44 46 45 47 private BasicStroke dashesLine; … … 61 63 62 64 protected LineElement(Cascade c, float default_major_z_index, BasicStroke line, Color color, BasicStroke dashesLine, 63 Color dashesBackground, float offset, float realWidth ) {65 Color dashesBackground, float offset, float realWidth, boolean wayDirectionArrows) { 64 66 super(c, default_major_z_index); 65 67 this.line = line; … … 69 71 this.offset = offset; 70 72 this.realWidth = realWidth; 73 this.wayDirectionArrows = wayDirectionArrows; 71 74 } 72 75 … … 264 267 } 265 268 266 return new LineElement(c, type.defaultMajorZIndex, line, color, dashesLine, dashesBackground, offset, realWidth); 269 boolean wayDirectionArrows = c.get(type.prefix + WAY_DIRECTION_ARROWS, env.osm.isSelected(), Boolean.class); 270 271 return new LineElement(c, type.defaultMajorZIndex, line, color, dashesLine, dashesBackground, 272 offset, realWidth, wayDirectionArrows); 267 273 } 268 274 … … 274 280 the way is tagged with a direction key 275 281 (even if the tag is negated as in oneway=false) or the way is selected */ 276 boolean showOrientation = !isModifier && (selected || paintSettings.isShowDirectionArrow()) && !paintSettings.isUseRealWidth(); 282 boolean showOrientation; 283 if (defaultSelectedHandling) { 284 showOrientation = !isModifier && (selected || paintSettings.isShowDirectionArrow()) && !paintSettings.isUseRealWidth(); 285 } else { 286 showOrientation = wayDirectionArrows; 287 } 277 288 boolean showOneway = !isModifier && !selected && 278 289 !paintSettings.isUseRealWidth() && … … 300 311 301 312 Color myColor = color; 302 if ( selected) {313 if (defaultSelectedHandling && selected) { 303 314 myColor = paintSettings.getSelectedColor(color.getAlpha()); 304 315 } else if (member || outermember) { … … 342 353 Objects.equals(dashesBackground, other.dashesBackground) && 343 354 offset == other.offset && 344 realWidth == other.realWidth; 355 realWidth == other.realWidth && 356 wayDirectionArrows == other.wayDirectionArrows; 345 357 } 346 358 … … 354 366 hash = 29 * hash + Float.floatToIntBits(offset); 355 367 hash = 29 * hash + Float.floatToIntBits(realWidth); 368 hash = 29 * hash + (this.wayDirectionArrows ? 1 : 0); 356 369 return hash; 357 370 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineTextElement.java
r9278 r9341 54 54 @Override 55 55 public int hashCode() { 56 return text.hashCode(); 56 int hash = super.hashCode(); 57 hash = 43 * hash + text.hashCode(); 58 return hash; 57 59 } 58 60 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r9284 r9341 285 285 if (painter.isInactiveMode() || n.isDisabled()) { 286 286 fillColor = settings.getInactiveColor(); 287 } else if ( selected) {287 } else if (defaultSelectedHandling && selected) { 288 288 fillColor = settings.getSelectedColor(fillColor.getAlpha()); 289 289 } else if (member) { … … 295 295 if (painter.isInactiveMode() || n.isDisabled()) { 296 296 strokeColor = settings.getInactiveColor(); 297 } else if ( selected) {297 } else if (defaultSelectedHandling && selected) { 298 298 strokeColor = settings.getSelectedColor(strokeColor.getAlpha()); 299 299 } else if (member) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
r9278 r9341 81 81 @Override 82 82 public int hashCode() { 83 int hash = 7;83 int hash = super.hashCode(); 84 84 hash = 83 * hash + this.pattern.hashCode(); 85 85 hash = 83 * hash + Float.floatToIntBits(this.offset); -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java
r9278 r9341 32 32 public boolean isModifier; // false, if style can serve as main style for the 33 33 // primitive; true, if it is a highlight or modifier 34 35 public StyleElement(float major_z_index, float z_index, float object_z_index, boolean isModifier) { 34 public boolean defaultSelectedHandling; 35 36 public StyleElement(float major_z_index, float z_index, float object_z_index, boolean isModifier, boolean defaultSelectedHandling) { 36 37 this.majorZIndex = major_z_index; 37 38 this.zIndex = z_index; 38 39 this.objectZIndex = object_z_index; 39 40 this.isModifier = isModifier; 41 this.defaultSelectedHandling = defaultSelectedHandling; 40 42 } 41 43 … … 45 47 objectZIndex = c.get(OBJECT_Z_INDEX, 0f, Float.class); 46 48 isModifier = c.get(MODIFIER, Boolean.FALSE, Boolean.class); 49 defaultSelectedHandling = c.isDefaultSelectedHandling(); 47 50 } 48 51
Note:
See TracChangeset
for help on using the changeset viewer.