Changeset 3836 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
- Timestamp:
- 2011-01-31T14:18:47+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
r3824 r3836 5 5 6 6 import org.openstreetmap.josm.data.osm.OsmPrimitive; 7 import org.openstreetmap.josm.data.osm.Relation; 7 8 import org.openstreetmap.josm.data.osm.Way; 8 9 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; … … 14 15 public Color color; 15 16 16 p ublicAreaElemStyle(long minScale, long maxScale, Color color) {17 super( minScale, maxScale);17 protected AreaElemStyle(Cascade c, Color color) { 18 super(c); 18 19 this.color = color; 20 } 21 22 public static AreaElemStyle create(Cascade c) { 23 Color color = c.get("fill-color", null, Color.class); 24 if (color == null) 25 return null; 26 return new AreaElemStyle(c, color); 19 27 } 20 28 … … 25 33 String name = painter.isShowNames() ? painter.getAreaName(w) : null; 26 34 painter.drawArea(w, w.isSelected() ? paintSettings.getSelectedColor() : color, name); 27 // line.paintPrimitive(way, paintSettings, painter, selected); 35 } else if (primitive instanceof Relation) { 36 painter.drawArea((Relation) primitive, selected ? paintSettings.getRelationSelectedColor() : color, painter.getAreaName(primitive)); 28 37 } 29 38 } … … 40 49 @Override 41 50 public int hashCode() { 42 return color.hashCode(); 51 return 11 * super.hashCode() + color.hashCode(); 43 52 } 44 53 45 54 @Override 46 55 public String toString() { 47 return "AreaElemStyle{" + "color=" + color + '}'; 56 return "AreaElemStyle{" + super.toString() + "color=" + color + '}'; 48 57 } 49 58 }
Note:
See TracChangeset
for help on using the changeset viewer.
