Changeset 35 in josm for src/org/openstreetmap/josm/data/osm/visitor
- Timestamp:
- 2005-12-28T01:29:01+01:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm/data/osm/visitor
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/data/osm/visitor/AddVisitor.java
r32 r35 26 26 public void visit(Node n) { 27 27 ds.nodes.add(n); 28 ds.deleted.remove(n); // remove if there.28 n.setDeleted(false); 29 29 } 30 30 public void visit(LineSegment ls) { 31 31 ds.lineSegments.add(ls); 32 ds.deleted.remove(ls); // remove if there.32 ls.setDeleted(false); 33 33 } 34 34 public void visit(Track t) { 35 35 ds.tracks.add(t); 36 ds.deleted.remove(t); // remove if there.36 t.setDeleted(false); 37 37 } 38 38 public void visit(Key k) {} -
src/org/openstreetmap/josm/data/osm/visitor/BoundingVisitor.java
r23 r35 21 21 * Calculate regarding lat/lon or x/y? 22 22 */ 23 public static enum Type {LATLON, XY} ;23 public static enum Type {LATLON, XY} 24 24 private Type type; 25 26 25 26 27 27 public BoundingVisitor(Type type) { 28 28 this.type = type; -
src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r30 r35 30 30 */ 31 31 private final MapView mv; 32 /**33 * Can be set to non-<code>null</code> and then replace every other color.34 */35 private final Color forceColor;36 32 37 33 /** … … 39 35 * @param g The graphics to draw to. 40 36 * @param mv The view to get screen coordinates from. 41 * @param forceColor If non-<code>null</code>, always draw with this color.42 37 */ 43 public SimplePaintVisitor(Graphics g, MapView mv , Color forceColor) {38 public SimplePaintVisitor(Graphics g, MapView mv) { 44 39 this.g = g; 45 40 this.mv = mv; 46 this.forceColor = forceColor;47 41 } 48 42 … … 70 64 */ 71 65 public void visit(Track t) { 66 // only to overwrite with blue 72 67 for (LineSegment ls : t.segments) 73 drawLineSegment(ls, darkblue); 68 if (!ls.isSelected()) // selected already in good color 69 drawLineSegment(ls, t.isSelected() ? Color.WHITE : darkblue); 74 70 } 75 71 … … 88 84 private void drawNode(Node n, Color color) { 89 85 Point p = mv.getScreenPoint(n.coor); 90 g.setColor( forceColor != null ? forceColor :color);86 g.setColor(color); 91 87 g.drawRect(p.x-1, p.y-1, 2, 2); 92 88 } … … 96 92 */ 97 93 private void drawLineSegment(LineSegment ls, Color col) { 98 if (forceColor != null) 99 col = forceColor; 100 else if (ls.isSelected()) 94 if (ls.isSelected()) 101 95 col = Color.WHITE; 102 96 g.setColor(col);
Note:
See TracChangeset
for help on using the changeset viewer.