Changeset 3859 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2011-02-05T19:47:07+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
r3858 r3859 65 65 @Override 66 66 public String toString() { 67 return "AreaElemStyle{" + super.toString() + "color=" + color+ '}';67 return "AreaElemStyle{" + super.toString() + "color=" + Utils.toString(color) + '}'; 68 68 } 69 69 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r3858 r3859 16 16 17 17 public static LineElemStyle createSimpleLineStyle(Color color) { 18 return new LineElemStyle(Cascade.EMPTY_CASCADE, -1f, 0f, color != null ? color : PaintColors.UNTAGGED.get(), null, null);18 return new LineElemStyle(Cascade.EMPTY_CASCADE, -1f, 0f, color != null ? color : PaintColors.UNTAGGED.get(), null, 0f, null); 19 19 } 20 20 public static final LineElemStyle UNTAGGED_WAY = createSimpleLineStyle(null); … … 24 24 public Color color; 25 25 private float[] dashed; 26 private float dashesOffset; 26 27 public Color dashedColor; 27 28 28 protected LineElemStyle(Cascade c, float width, float realWidth, Color color, float[] dashed, Color dashedColor) {29 protected LineElemStyle(Cascade c, float width, float realWidth, Color color, float[] dashed, float dashesOffset, Color dashedColor) { 29 30 super(c); 30 31 setWidth(width); … … 32 33 this.color = color; 33 34 this.dashed = dashed; 35 this.dashesOffset = dashesOffset; 34 36 this.dashedColor = dashedColor; 35 37 } … … 84 86 } 85 87 } 88 float dashesOffset = c.get(prefix + "dashes-offset", 0f, Float.class); 86 89 Color dashesBackground = c.get(prefix + "dashes-background-color", null, Color.class); 87 88 return new LineElemStyle(c, width, realWidth, color, dashes, dashesBackground); 90 if (dashesBackground != null) { 91 pAlpha = color_float2int(c.get(prefix + "dashes-background-opacity", null, Float.class)); 92 if (pAlpha != null) { 93 alpha = pAlpha; 94 } 95 dashesBackground = new Color(dashesBackground.getRed(), dashesBackground.getGreen(), 96 dashesBackground.getBlue(), alpha); 97 } 98 99 return new LineElemStyle(c, width, realWidth, color, dashes, dashesOffset, dashesBackground); 89 100 } 90 101 … … 140 151 } 141 152 142 painter.drawWay(w, markColor != null ? markColor : color, myWidth, dashed, myDashedColor, showDirection, 143 selected ? false : reversedDirection, showOnlyHeadArrowOnly); 153 painter.drawWay(w, markColor != null ? markColor : color, myWidth, dashed, 154 dashesOffset, myDashedColor, showDirection, 155 selected ? false : reversedDirection, showOnlyHeadArrowOnly); 144 156 145 157 if(paintSettings.isShowOrderNumber()) { … … 177 189 Utils.equal(color, other.color) && 178 190 Arrays.equals(dashed, other.dashed) && 191 dashesOffset == other.dashesOffset && 179 192 Utils.equal(dashedColor, other.dashedColor); 180 193 } … … 187 200 hash = 29 * hash + color.hashCode(); 188 201 hash = 29 * hash + Arrays.hashCode(dashed); 202 hash = 29 * hash + Float.floatToIntBits(dashesOffset); 189 203 hash = 29 * hash + (dashedColor != null ? dashedColor.hashCode() : 0); 190 204 return hash; … … 193 207 @Override 194 208 public String toString() { 195 return "LineElemStyle{" + super.toString() + "width=" + width + " realWidth=" + realWidth + " color=" + color + " dashed=" + Arrays.toString(dashed) + " dashedColor=" + dashedColor + '}'; 209 return "LineElemStyle{" + super.toString() + "width=" + width + 210 " realWidth=" + realWidth + " color=" + Utils.toString(color) + 211 " dashed=" + Arrays.toString(dashed) + 212 (dashesOffset == 0f ? "" : " dashesOffses=" + dashesOffset) + 213 " dashedColor=" + Utils.toString(dashedColor) + '}'; 196 214 } 197 215 }
Note:
See TracChangeset
for help on using the changeset viewer.