- Timestamp:
- 2009-11-14T18:47:09+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r2412 r2450 11 11 import java.awt.Cursor; 12 12 import java.awt.EventQueue; 13 import java.awt.Graphics;14 13 import java.awt.Graphics2D; 15 14 import java.awt.Point; … … 41 40 import org.openstreetmap.josm.command.Command; 42 41 import org.openstreetmap.josm.command.SequenceCommand; 42 import org.openstreetmap.josm.data.Bounds; 43 43 import org.openstreetmap.josm.data.SelectionChangedListener; 44 44 import org.openstreetmap.josm.data.coor.EastNorth; … … 879 879 } 880 880 881 public void paint(Graphics g, MapView mv) { 881 public void paint(Graphics2D g, MapView mv, Bounds box) { 882 882 if (!drawHelperLine || wayIsFinished || shift) return; 883 883 -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r2432 r2450 8 8 import java.awt.Color; 9 9 import java.awt.Cursor; 10 import java.awt.Graphics;11 10 import java.awt.Graphics2D; 12 11 import java.awt.Point; … … 29 28 import org.openstreetmap.josm.command.MoveCommand; 30 29 import org.openstreetmap.josm.command.SequenceCommand; 30 import org.openstreetmap.josm.data.Bounds; 31 31 import org.openstreetmap.josm.data.coor.EastNorth; 32 32 import org.openstreetmap.josm.data.osm.Node; … … 230 230 } 231 231 232 public void paint(Graphics g, MapView mv) { 232 public void paint(Graphics2D g, MapView mv, Bounds box) { 233 233 if (mode == Mode.select) { 234 234 // Nothing to do -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r2439 r2450 20 20 21 21 import org.openstreetmap.josm.data.SelectionChangedListener; 22 import org.openstreetmap.josm.data.osm.QuadBuckets.BBox;23 22 24 23 /** -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r2437 r2450 5 5 import org.openstreetmap.josm.data.coor.EastNorth; 6 6 import org.openstreetmap.josm.data.coor.LatLon; 7 import org.openstreetmap.josm.data.osm.QuadBuckets.BBox;8 7 import org.openstreetmap.josm.data.osm.visitor.Visitor; 9 8 -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2448 r2450 19 19 20 20 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.data.osm.QuadBuckets.BBox;22 21 import org.openstreetmap.josm.data.osm.visitor.Visitor; 23 22 import org.openstreetmap.josm.gui.mappaint.ElemStyle; … … 219 218 * @param disabled true, if this primitive is disabled; false, otherwise 220 219 */ 221 publicvoid setDisabled(boolean disabled) {220 void setDisabled(boolean disabled) { 222 221 if (disabled) { 223 222 flags |= FLAG_DISABLED; -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r2449 r2450 58 58 public static double WORLD_PARTS = (1 << NR_LEVELS); 59 59 60 public static int MAX_OBJECTS_PER_LEVEL = 16; 61 // has to be a power of 2 62 public static int TILES_PER_LEVEL_SHIFT = 2; 63 public static int TILES_PER_LEVEL = 1<<TILES_PER_LEVEL_SHIFT; 64 // Maybe this should just be a Rectangle?? 65 public static class BBox 66 { 67 private double xmin = Double.POSITIVE_INFINITY; 68 private double xmax = Double.NEGATIVE_INFINITY; 69 private double ymin = Double.POSITIVE_INFINITY; 70 private double ymax = Double.NEGATIVE_INFINITY; 71 void sanity() 72 { 73 if (xmin < -180.0) { 74 xmin = -180.0; 75 } 76 if (xmax > 180.0) { 77 xmax = 180.0; 78 } 79 if (ymin < -90.0) { 80 ymin = -90.0; 81 } 82 if (ymax > 90.0) { 83 ymax = 90.0; 84 } 85 if ((xmin < -180.0) || 86 (xmax > 180.0) || 87 (ymin < -90.0) || 88 (ymax > 90.0)) 89 throw new IllegalArgumentException("bad BBox: " + this); 90 } 91 @Override 92 public String toString() 93 { 94 return "[ x: " + xmin + " -> " + xmax + 95 ", y: " + ymin + " -> " + ymax + " ]"; 96 } 97 double min(double a, double b) 98 { 99 if (a < b) 100 return a; 101 return b; 102 } 103 double max(double a, double b) 104 { 105 if (a > b) 106 return a; 107 return b; 108 } 109 private void add(LatLon c) 110 { 111 xmin = min(xmin, c.lon()); 112 xmax = max(xmax, c.lon()); 113 ymin = min(ymin, c.lat()); 114 ymax = max(ymax, c.lat()); 115 } 116 public BBox(LatLon a, LatLon b) 117 { 118 add(a); 119 add(b); 120 sanity(); 121 } 122 public BBox(double a_x, double a_y, double b_x, double b_y) 123 { 124 xmin = min(a_x, b_x); 125 xmax = max(a_x, b_x); 126 ymin = min(a_y, b_y); 127 ymax = max(a_y, b_y); 128 sanity(); 129 } 130 public BBox(Way w) 131 { 132 for (Node n : w.getNodes()) { 133 LatLon coor = n.getCoor(); 134 if (coor == null) { 135 continue; 136 } 137 add(coor); 138 } 139 this.sanity(); 140 } 141 public double height() 142 { 143 return ymax-ymin; 144 } 145 public double width() 146 { 147 return xmax-xmin; 148 } 149 boolean bounds(BBox b) 150 { 151 if (!(xmin <= b.xmin) || 152 !(xmax >= b.xmax) || 153 !(ymin <= b.ymin) || 154 !(ymax >= b.ymax)) 155 return false; 156 return true; 157 } 158 boolean bounds(LatLon c) 159 { 160 if ((xmin <= c.lon()) && 161 (xmax >= c.lon()) && 162 (ymin <= c.lat()) && 163 (ymax >= c.lat())) 164 return true; 165 return false; 166 } 167 boolean inside(BBox b) 168 { 169 if (xmin >= b.xmax) 170 return false; 171 if (xmax <= b.xmin) 172 return false; 173 if (ymin >= b.ymax) 174 return false; 175 if (ymax <= b.ymin) 176 return false; 177 return true; 178 } 179 boolean intersects(BBox b) 180 { 181 return this.inside(b) || b.inside(this); 182 } 183 List<LatLon> points() 184 { 185 LatLon p1 = new LatLon(ymin, xmin); 186 LatLon p2 = new LatLon(ymin, xmax); 187 LatLon p3 = new LatLon(ymax, xmin); 188 LatLon p4 = new LatLon(ymax, xmax); 189 List<LatLon> ret = new ArrayList<LatLon>(); 190 ret.add(p1); 191 ret.add(p2); 192 ret.add(p3); 193 ret.add(p4); 194 return ret; 195 } 196 } 60 public static int MAX_OBJECTS_PER_LEVEL = 2; 197 61 class QBLevel 198 62 { … … 294 158 continue; 295 159 } 296 if (children == null) 160 if (children == null) { 297 161 children = newChildren(); 162 } 298 163 if (children[new_index] == null) { 299 164 children[new_index] = new QBLevel(this, new_index); … … 725 590 public BBox bbox() 726 591 { 727 if (bbox != null) { 728 bbox.sanity(); 592 if (bbox != null) 729 593 return bbox; 730 }731 594 if (level == 0) { 732 595 bbox = new BBox(-180, 90, 180, -90); … … 738 601 bbox = new BBox(bottom_left, top_right); 739 602 } 740 bbox.sanity();741 603 return bbox; 742 604 } … … 1100 962 out("search bbox before sanity: " + bbox); 1101 963 } 1102 bbox.sanity();1103 964 if (debug) { 1104 965 out("search bbox after sanity: " + bbox); … … 1124 985 { 1125 986 BBox bbox = new BBox(b1.lon(), b1.lat(), b2.lon(), b2.lat()); 1126 bbox.sanity();1127 987 return this.search(bbox); 1128 988 } -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r2439 r2450 7 7 import java.util.Set; 8 8 9 import org.openstreetmap.josm.data.osm.QuadBuckets.BBox;10 9 import org.openstreetmap.josm.data.osm.visitor.Visitor; 11 10 import org.openstreetmap.josm.tools.CopyList; -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r2437 r2450 9 9 import java.util.List; 10 10 11 import org.openstreetmap.josm.data.osm.QuadBuckets.BBox;12 11 import org.openstreetmap.josm.data.osm.visitor.Visitor; 13 12 import org.openstreetmap.josm.tools.CopyList; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r2392 r2450 32 32 33 33 import org.openstreetmap.josm.Main; 34 import org.openstreetmap.josm.data.Bounds; 34 35 import org.openstreetmap.josm.data.coor.EastNorth; 35 36 import org.openstreetmap.josm.data.coor.LatLon; 37 import org.openstreetmap.josm.data.osm.BBox; 36 38 import org.openstreetmap.josm.data.osm.DataSet; 37 39 import org.openstreetmap.josm.data.osm.Node; … … 114 116 return (styles != null) ? styles.getIcon(osm) : null; 115 117 116 if(osm.mappaintStyle == null && styles != null) { 117 osm.mappaintStyle = styles.getIcon(osm); 118 } 119 120 return (IconElemStyle)osm.mappaintStyle; 118 if(osm.mappaintStyle == null && styles != null) { 119 osm.mappaintStyle = styles.getIcon(osm); 120 } 121 122 return (IconElemStyle)osm.mappaintStyle; 121 123 } 122 124 … … 1445 1447 /* Shows areas before non-areas */ 1446 1448 @Override 1447 public void visitAll(DataSet data, Boolean virtual) { 1449 public void visitAll(DataSet data, boolean virtual, Bounds bounds) { 1450 BBox bbox = new BBox(bounds); 1448 1451 this.data = data; 1449 1452 //boolean profiler = Main.pref.getBoolean("mappaint.profiler",false); … … 1521 1524 /*** AREAS ***/ 1522 1525 // profilerN = 0; 1523 for (final Way osm : selectedLast(data, data. getWays())) {1526 for (final Way osm : selectedLast(data, data.searchWays(bbox))) { 1524 1527 if (drawable(osm) 1525 1528 && osm.mappaintVisibleCode != viewid && osm.mappaintDrawnCode != paintid) { … … 1614 1617 /*** NODES ***/ 1615 1618 //profilerN = 0; 1616 for (final Node osm: data. getNodes()) {1619 for (final Node osm: data.searchNodes(bbox)) { 1617 1620 if (!osm.incomplete && !osm.isDeleted() && (data.isSelected(osm) || !osm.isFiltered()) 1618 1621 && osm.mappaintVisibleCode != viewid && osm.mappaintDrawnCode != paintid) … … 1634 1637 // profilerN = 0; 1635 1638 currentColor = nodeColor; 1636 for (final OsmPrimitive osm: data. getWays()) {1639 for (final OsmPrimitive osm: data.searchWays(bbox)) { 1637 1640 if (osm.isUsable() && !osm.isFiltered() 1638 1641 && osm.mappaintVisibleCode != viewid ) -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r2381 r2450 19 19 20 20 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.data.Bounds; 21 22 import org.openstreetmap.josm.data.osm.DataSet; 22 23 import org.openstreetmap.josm.data.osm.Node; … … 129 130 130 131 DataSet ds; 131 public void visitAll(DataSet data, Boolean virtual) {132 public void visitAll(DataSet data, boolean virtual, Bounds bounds) { 132 133 this.ds = data; 133 134 //boolean profiler = Main.pref.getBoolean("simplepaint.profiler",false); -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r2446 r2450 50 50 import org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker; 51 51 import org.openstreetmap.josm.tools.AudioPlayer; 52 52 53 53 54 /** … … 385 386 tempG.fillRect(0, 0, getWidth(), getHeight()); 386 387 388 Bounds box = getLatLonBounds(g.getClipBounds()); 389 387 390 for (Layer l: getVisibleLayersInZOrder()) { 388 l.paint(tempG, this); 391 l.paint(tempG, this, box); 389 392 } 390 393 for (MapViewPaintable mvp : temporaryLayers) { 391 mvp.paint(tempG, this); 394 mvp.paint(tempG, this, box); 392 395 } 393 396 -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r2426 r2450 4 4 5 5 import java.awt.Point; 6 import java.awt.Rectangle; 6 7 import java.util.ArrayList; 7 8 import java.util.Collection; … … 20 21 import org.openstreetmap.josm.data.coor.EastNorth; 21 22 import org.openstreetmap.josm.data.coor.LatLon; 23 import org.openstreetmap.josm.data.osm.BBox; 22 24 import org.openstreetmap.josm.data.osm.DataSet; 23 25 import org.openstreetmap.josm.data.osm.Node; … … 25 27 import org.openstreetmap.josm.data.osm.Way; 26 28 import org.openstreetmap.josm.data.osm.WaySegment; 27 import org.openstreetmap.josm.data.osm.QuadBuckets.BBox;28 29 import org.openstreetmap.josm.data.projection.Projection; 29 30 import org.openstreetmap.josm.gui.help.Helpful; … … 154 155 public LatLon getLatLon(int x, int y) { 155 156 return getProjection().eastNorth2latlon(getEastNorth(x, y)); 157 } 158 159 /** 160 * @param r 161 * @return Minimum bounds that will cover rectangle 162 */ 163 public Bounds getLatLonBounds(Rectangle r) { 164 // TODO Maybe this should be (optional) method of Projection implementation 165 EastNorth p1 = getEastNorth(r.x, r.y); 166 EastNorth p2 = getEastNorth(r.x + r.width, r.y + r.height); 167 168 Bounds result = new Bounds(Main.proj.eastNorth2latlon(p1)); 169 170 double eastMin = Math.min(p1.east(), p2.east()); 171 double eastMax = Math.max(p1.east(), p2.east()); 172 double northMin = Math.min(p1.north(), p2.north()); 173 double northMax = Math.min(p1.north(), p2.north()); 174 double deltaEast = (eastMax - eastMin) / 10; 175 double deltaNorth = (northMax - northMin) / 10; 176 177 for (int i=0; i < 10; i++) { 178 result.extend(Main.proj.eastNorth2latlon(new EastNorth(eastMin + i * deltaEast, northMin))); 179 result.extend(Main.proj.eastNorth2latlon(new EastNorth(eastMin + i * deltaEast, northMax))); 180 result.extend(Main.proj.eastNorth2latlon(new EastNorth(eastMin, northMin + i * deltaNorth))); 181 result.extend(Main.proj.eastNorth2latlon(new EastNorth(eastMax, northMin + i * deltaNorth))); 182 } 183 184 return result; 156 185 } 157 186 -
trunk/src/org/openstreetmap/josm/gui/layer/GeoImageLayer.java
r2322 r2450 9 9 import java.awt.Component; 10 10 import java.awt.Cursor; 11 import java.awt.Graphics;12 11 import java.awt.Graphics2D; 13 12 import java.awt.GridBagLayout; … … 63 62 import org.openstreetmap.josm.Main; 64 63 import org.openstreetmap.josm.actions.RenameLayerAction; 64 import org.openstreetmap.josm.data.Bounds; 65 65 import org.openstreetmap.josm.data.coor.CachedLatLon; 66 66 import org.openstreetmap.josm.data.coor.LatLon; … … 641 641 } 642 642 643 @Override public void paint(Graphics g, MapView mv) { 643 @Override public void paint(Graphics2D g, MapView mv, Bounds box) { 644 644 int clickedIndex = -1; 645 645 -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r2381 r2450 10 10 import java.awt.Color; 11 11 import java.awt.Component; 12 import java.awt.Graphics;13 12 import java.awt.Graphics2D; 14 13 import java.awt.GridBagLayout; … … 49 48 import org.openstreetmap.josm.actions.RenameLayerAction; 50 49 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTaskList; 50 import org.openstreetmap.josm.data.Bounds; 51 51 import org.openstreetmap.josm.data.coor.EastNorth; 52 52 import org.openstreetmap.josm.data.coor.LatLon; … … 143 143 tr("Select line drawing options"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); 144 144 switch (answer) { 145 146 147 148 149 145 case JOptionPane.CANCEL_OPTION: 146 case JOptionPane.CLOSED_OPTION: 147 return; 148 default: 149 // continue 150 150 } 151 151 if (group.getSelection() == r[0].getModel()) { … … 174 174 ); 175 175 switch (answer) { 176 177 178 179 180 181 182 183 176 case 0: 177 Main.pref.putColor("layer " + getName(), c.getColor()); 178 break; 179 case 1: 180 return; 181 case 2: 182 Main.pref.putColor("layer " + getName(), null); 183 break; 184 184 } 185 185 Main.map.repaint(); … … 444 444 445 445 @Override 446 public void paint(Graphics g, MapView mv) { 446 public void paint(Graphics2D g, MapView mv, Bounds box) { 447 447 448 448 /**************************************************************** … … 490 490 if(lineWidth != 0) 491 491 { 492 Graphics2D g2d = (Graphics2D)g; 493 g2d.setStroke(new BasicStroke(lineWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND)); 492 g.setStroke(new BasicStroke(lineWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND)); 494 493 } 495 494 … … 531 530 532 531 switch (colored) { 533 case velocity: 534 double dtime = trkPnt.time - oldWp.time; 535 double vel = dist / dtime; 536 double velColor = vel / colorTracksTune * 255; 537 // Bad case first 538 if (dtime <= 0 || vel < 0 || velColor > 255) { 539 trkPnt.customColoring = colors[255]; 540 } else { 541 trkPnt.customColoring = colors[(int) (velColor)]; 532 case velocity: 533 double dtime = trkPnt.time - oldWp.time; 534 double vel = dist / dtime; 535 double velColor = vel / colorTracksTune * 255; 536 // Bad case first 537 if (dtime <= 0 || vel < 0 || velColor > 255) { 538 trkPnt.customColoring = colors[255]; 539 } else { 540 trkPnt.customColoring = colors[(int) (velColor)]; 541 } 542 break; 543 544 case dilution: 545 if (trkPnt.attr.get("hdop") != null) { 546 float hdop = ((Float) trkPnt.attr.get("hdop")).floatValue(); 547 if (hdop < 0) { 548 hdop = 0; 542 549 } 543 break; 544 545 case dilution: 546 if (trkPnt.attr.get("hdop") != null) { 547 float hdop = ((Float) trkPnt.attr.get("hdop")).floatValue(); 548 if (hdop < 0) { 549 hdop = 0; 550 } 551 int hdoplvl = Math.round(hdop * Main.pref.getInteger("hdop.factor", 25)); 552 // High hdop is bad, but high values in colors are green. 553 // Therefore inverse the logic 554 int hdopcolor = 255 - (hdoplvl > 255 ? 255 : hdoplvl); 555 trkPnt.customColoring = colors[hdopcolor]; 556 } 557 break; 550 int hdoplvl = Math.round(hdop * Main.pref.getInteger("hdop.factor", 25)); 551 // High hdop is bad, but high values in colors are green. 552 // Therefore inverse the logic 553 int hdopcolor = 255 - (hdoplvl > 255 ? 255 : hdoplvl); 554 trkPnt.customColoring = colors[hdopcolor]; 555 } 556 break; 558 557 } 559 558 … … 838 837 ); 839 838 switch(ret) { 840 841 842 843 844 839 case JOptionPane.CANCEL_OPTION: 840 case JOptionPane.CLOSED_OPTION: 841 return; 842 default: 843 // continue 845 844 } 846 845 … … 936 935 ); 937 936 switch(ret) { 938 939 940 941 942 937 case JOptionPane.CANCEL_OPTION: 938 case JOptionPane.CLOSED_OPTION: 939 return; 940 default: 941 // continue 943 942 } 944 943 } -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r2192 r2450 6 6 7 7 import java.awt.Component; 8 import java.awt.Graphics; 8 import java.awt.Graphics2D; 9 9 import java.awt.event.ActionEvent; 10 10 import java.beans.PropertyChangeListener; … … 20 20 import org.openstreetmap.josm.actions.SaveAction; 21 21 import org.openstreetmap.josm.actions.SaveAsAction; 22 import org.openstreetmap.josm.data.Bounds; 22 23 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 23 24 import org.openstreetmap.josm.gui.MapView; … … 98 99 * @param mv The object that can translate GeoPoints to screen coordinates. 99 100 */ 100 abstract public void paint(Graphics g, MapView mv); 101 abstract public void paint(Graphics2D g, MapView mv, Bounds box); 101 102 /** 102 103 * Return a representative small image for this layer. The image must not -
trunk/src/org/openstreetmap/josm/gui/layer/MapViewPaintable.java
r1169 r2450 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import java.awt.Graphics; 4 import java.awt.Graphics2D; 5 5 6 import org.openstreetmap.josm.data.Bounds; 6 7 import org.openstreetmap.josm.gui.MapView; 7 8 … … 12 13 * @param mv The object that can translate GeoPoints to screen coordinates. 13 14 */ 14 abstract publicvoid paint(Graphics g, MapView mv);15 void paint(Graphics2D g, MapView mv, Bounds bbox); 15 16 16 17 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r2434 r2450 12 12 import java.awt.Component; 13 13 import java.awt.Composite; 14 import java.awt.Graphics;15 14 import java.awt.Graphics2D; 16 15 import java.awt.GridBagLayout; … … 40 39 import org.openstreetmap.josm.actions.RenameLayerAction; 41 40 import org.openstreetmap.josm.command.PurgePrimitivesCommand; 41 import org.openstreetmap.josm.data.Bounds; 42 42 import org.openstreetmap.josm.data.conflict.Conflict; 43 43 import org.openstreetmap.josm.data.conflict.ConflictCollection; … … 204 204 * Draw nodes last to overlap the ways they belong to. 205 205 */ 206 @Override public void paint(final Graphics g, final MapView mv) { 206 @Override public void paint(final Graphics2D g, final MapView mv, Bounds box) { 207 207 boolean active = mv.getActiveLayer() == this; 208 208 boolean inactive = !active && Main.pref.getBoolean("draw.data.inactive_color", true); … … 245 245 painter.setNavigatableComponent(mv); 246 246 painter.inactive = inactive; 247 painter.visitAll(data, virtual); 247 painter.visitAll(data, virtual, box); 248 248 Main.map.conflictDialog.paintConflicts(g, mv); 249 249 } -
trunk/src/org/openstreetmap/josm/gui/layer/RawGpsLayer.java
r2381 r2450 9 9 import java.awt.Color; 10 10 import java.awt.Component; 11 import java.awt.Graphics; 11 import java.awt.Graphics2D; 12 12 import java.awt.GridBagLayout; 13 13 import java.awt.Point; … … 33 33 import org.openstreetmap.josm.Main; 34 34 import org.openstreetmap.josm.actions.RenameLayerAction; 35 import org.openstreetmap.josm.data.Bounds; 35 36 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 36 37 import org.openstreetmap.josm.data.coor.EastNorth; … … 122 123 } 123 124 124 @Override public void paint(Graphics g, MapView mv) { 125 @Override public void paint(Graphics2D g, MapView mv, Bounds box) { 125 126 g.setColor(Main.pref.getColor(marktr("gps point"), "layer "+getName(), Color.gray)); 126 127 Point old = null; … … 244 245 JOptionPane.PLAIN_MESSAGE, null,options, options[0]); 245 246 switch (answer) { 246 247 248 249 250 251 252 253 247 case 0: 248 Main.pref.putColor("layer "+getName(), c.getColor()); 249 break; 250 case 1: 251 return; 252 case 2: 253 Main.pref.putColor("layer "+getName(), null); 254 break; 254 255 } 255 256 Main.map.repaint(); -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r2017 r2450 8 8 import java.awt.Color; 9 9 import java.awt.Component; 10 import java.awt.Graphics; 10 import java.awt.Graphics2D; 11 11 import java.awt.Point; 12 12 import java.awt.event.ActionEvent; … … 29 29 import org.openstreetmap.josm.Main; 30 30 import org.openstreetmap.josm.actions.RenameLayerAction; 31 import org.openstreetmap.josm.data.Bounds; 31 32 import org.openstreetmap.josm.data.coor.LatLon; 32 33 import org.openstreetmap.josm.data.gpx.GpxData; … … 152 153 } 153 154 154 @Override public void paint(Graphics g, MapView mv) { 155 @Override public void paint(Graphics2D g, MapView mv, Bounds box) { 155 156 boolean mousePressedTmp = mousePressed; 156 157 Point mousePos = mv.getMousePosition(); … … 210 211 ); 211 212 switch (answer) { 212 213 214 215 216 217 218 219 213 case 0: 214 Main.pref.putColor("layer "+getName(), c.getColor()); 215 break; 216 case 1: 217 return; 218 case 2: 219 Main.pref.putColor("layer "+getName(), null); 220 break; 220 221 } 221 222 Main.map.repaint();
Note:
See TracChangeset
for help on using the changeset viewer.