Changeset 86 in josm for src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
- Timestamp:
- 2006-04-21T14:31:51+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r75 r86 6 6 7 7 import org.openstreetmap.josm.Main; 8 import org.openstreetmap.josm.data.osm. LineSegment;8 import org.openstreetmap.josm.data.osm.Segment; 9 9 import org.openstreetmap.josm.data.osm.Node; 10 10 import org.openstreetmap.josm.data.osm.Way; … … 32 32 */ 33 33 private final NavigatableComponent nc; 34 34 35 35 /** 36 36 * Construct the painter visitor. … … 42 42 this.nc = mv; 43 43 } 44 44 45 45 /** 46 46 * Draw a small rectangle. … … 50 50 */ 51 51 public void visit(Node n) { 52 drawNode(n, n. isSelected()? getPreferencesColor("selected", Color.WHITE)52 drawNode(n, n.selected ? getPreferencesColor("selected", Color.WHITE) 53 53 : getPreferencesColor("node", Color.RED)); 54 54 } … … 58 58 * White if selected (as always) or green otherwise. 59 59 */ 60 public void visit( LineSegment ls) {61 draw LineSegment(ls, getPreferencesColor("segment", darkgreen));60 public void visit(Segment ls) { 61 drawSegment(ls, getPreferencesColor("segment", darkgreen)); 62 62 } 63 63 64 64 /** 65 * Draw a darkblue line for all linesegments.66 * @param tThe way to draw.65 * Draw a darkblue line for all segments. 66 * @param w The way to draw. 67 67 */ 68 public void visit(Way t) {68 public void visit(Way w) { 69 69 // only to overwrite with blue 70 70 Color wayColor = getPreferencesColor("way", darkblue); 71 for ( LineSegment ls : t.segments) {71 for (Segment ls : w.segments) { 72 72 if (ls.incomplete) { 73 73 wayColor = getPreferencesColor("incomplete way", darkerblue); … … 75 75 } 76 76 } 77 for ( LineSegment ls : t.segments)78 if (!ls. isSelected()) // selected already in good color79 draw LineSegment(ls, t.isSelected()? getPreferencesColor("selected", Color.WHITE) : wayColor);77 for (Segment ls : w.segments) 78 if (!ls.selected) // selected already in good color 79 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.WHITE) : wayColor); 80 80 } 81 81 … … 95 95 * Draw a line with the given color. 96 96 */ 97 private void draw LineSegment(LineSegment ls, Color col) {97 private void drawSegment(Segment ls, Color col) { 98 98 if (ls.incomplete) 99 99 return; 100 if (ls. isSelected())100 if (ls.selected) 101 101 col = getPreferencesColor("selected", Color.WHITE); 102 102 g.setColor(col); … … 105 105 g.drawLine(p1.x, p1.y, p2.x, p2.y); 106 106 } 107 108 p rivateColor getPreferencesColor(String colName, Color def) {107 108 public static Color getPreferencesColor(String colName, Color def) { 109 109 String colStr = Main.pref.get("color."+colName); 110 110 if (colStr.equals(""))
Note:
See TracChangeset
for help on using the changeset viewer.