Ticket #1642: dilution2.diff
| File dilution2.diff, 7.9 KB (added by , 17 years ago) |
|---|
-
E:/Programmierumgebungen/Projekte/JOSM_PATCHPREPARE/src/org/openstreetmap/josm/actions/AutoScaleAction.java
22 22 */ 23 23 public class AutoScaleAction extends JosmAction { 24 24 25 public static final String[] modes = { marktr("data"), marktr("layer"), marktr("selection"), marktr("conflict") };25 public static final String[] modes = {marktr("data"), marktr("layer"), marktr("selection"), marktr("conflict") }; 26 26 private final String mode; 27 27 28 28 private static int getModeShortcut(String mode) { -
E:/Programmierumgebungen/Projekte/JOSM_PATCHPREPARE/src/org/openstreetmap/josm/gui/MapScaler.java
20 20 private final NavigatableComponent mv; 21 21 public MapScaler(NavigatableComponent mv, Projection proj) { 22 22 this.mv = mv; 23 setSize(100, 30);23 setSize(100,220); 24 24 setOpaque(false); 25 25 } 26 26 … … 38 38 g.drawLine(24, 3, 24, 7); 39 39 g.drawLine(74, 3, 74, 7); 40 40 g.drawString(text, (int)(50-bound.getWidth()/2), 23); 41 42 g.drawString("Dilution:", 0, 49); 43 Color c[] = org.openstreetmap.josm.data.gpx.WayPoint.dcolors; 44 int[] d = org.openstreetmap.josm.data.gpx.WayPoint.dilution_steps; 45 for(int i = 0; i < 10; i++) { 46 g.setColor(c[i]); 47 48 int y = 57+i*17; 49 50 g.fillRect(1, y, 9, 9); 51 g.setColor(Color.white); 52 g.drawRect(0, y-1, 10, 10); 53 g.drawString(Integer.toString(d[i]), 15, y+9); 54 } 41 55 } 42 56 43 57 public String helpTopic() { -
E:/Programmierumgebungen/Projekte/JOSM_PATCHPREPARE/src/org/openstreetmap/josm/gui/MainMenu.java
125 125 public final JosmAction about = new AboutAction(); 126 126 public final HistoryInfoAction historyinfo = new HistoryInfoAction(); 127 127 128 128 129 public final JMenu fileMenu = new JMenu(tr("File")); 129 130 public final JMenu editMenu = new JMenu(tr("Edit")); 130 131 public final JMenu viewMenu = new JMenu(tr("View")); -
E:/Programmierumgebungen/Projekte/JOSM_PATCHPREPARE/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
559 559 ********** STEP 3f - DRAW SMALL POINTS INSTEAD OF LINES ******** 560 560 ****************************************************************/ 561 561 if (!large && !lines){ 562 g.setColor(neutralColor);562 //g.setColor(neutralColor); 563 563 for (GpxTrack trk : data.tracks) { 564 564 for (Collection<WayPoint> segment : trk.trackSegs) { 565 565 for (WayPoint trkPnt : segment) { 566 566 if (Double.isNaN(trkPnt.latlon.lat()) || Double.isNaN(trkPnt.latlon.lon())) 567 567 continue; 568 568 Point screen = mv.getPoint(trkPnt.eastNorth); 569 if(trkPnt.dop_color==null) g.setColor(neutralColor); 570 else g.setColor(trkPnt.dop_color); 569 571 g.drawRect(screen.x, screen.y, 0, 0); 570 572 } // end for trkpnt 571 573 } // end for segment -
E:/Programmierumgebungen/Projekte/JOSM_PATCHPREPARE/src/org/openstreetmap/josm/io/GpxReader.java
224 224 break; 225 225 case wpt: 226 226 if (qName.equals("ele") || qName.equals("magvar") 227 || qName.equals("hdop") || qName.equals("vdop") 228 || qName.equals("pdop") 227 229 || qName.equals("geoidheight") || qName.equals("name") 228 230 || qName.equals("sym") || qName.equals("type")) { 229 231 currentWayPoint.attr.put(qName, accumulator.toString()); … … 238 240 currentRoute.routePoints.add(currentWayPoint); 239 241 } else if (qName.equals("trkpt")) { 240 242 currentState = states.pop(); 243 currentWayPoint.complete(); 241 244 currentTrackSeg.add(currentWayPoint); 242 245 } else if (qName.equals("wpt")) { 243 246 currentState = states.pop(); -
E:/Programmierumgebungen/Projekte/JOSM_PATCHPREPARE/src/org/openstreetmap/josm/data/coor/LatLon.java
27 27 * Possible ways to display coordinates 28 28 */ 29 29 public enum CoordinateFormat { 30 DECIMAL_DEGREES {public String toString() {return tr("Decimal Degrees");}},30 DECIMAL_DEGREES {public String toString() {return tr("Decimal Degrees");}}, 31 31 DEGREES_MINUTES_SECONDS {public String toString() {return tr("Degrees Minutes Seconds");}}; 32 32 } 33 33 -
E:/Programmierumgebungen/Projekte/JOSM_PATCHPREPARE/src/org/openstreetmap/josm/data/gpx/WayPoint.java
20 20 public Color speedLineColor; 21 21 public boolean drawLine; 22 22 public int dir; 23 public Color dop_color; // to remove 23 24 24 25 public WayPoint(LatLon ll) { 25 26 latlon = ll; 26 27 eastNorth = Main.proj.latlon2eastNorth(ll); 27 28 } 29 30 public void complete() { 31 float hdop = 0; 32 //if (attr.containsKey("hdop")) 33 try {hdop = Float.parseFloat(attr.get("hdop").toString());} catch(Exception e){} 28 34 35 if(hdop==0) dop_color = null; 36 else { 37 dop_color = dcolors[dcolors.length-1]; 38 for(int i = 0; i < dilution_steps.length; i++) { 39 if(hdop <= dilution_steps[i] ) { 40 dop_color = dcolors[i]; 41 break; 42 } 43 } 44 } 45 } 46 47 public static Color[] dcolors = { 48 Color.WHITE, 49 Color.CYAN, 50 Color.BLUE, 51 Color.GREEN, 52 Color.YELLOW, 53 new Color(191,127,0), // dark orange, 54 Color.MAGENTA, 55 Color.RED, // dark red 56 new Color(127,0,0), 57 Color.DARK_GRAY 58 }; 59 public static int[] dilution_steps = { 60 1,2,3,4,5,6,7,8,9,10 61 }; 62 29 63 @Override 30 64 public String toString() { 31 65 return "WayPoint (" + (attr.containsKey("name") ? attr.get("name") + ", " :"") + latlon.toString() + ", " + attr + ")"; … … 34 68 /** 35 69 * Convert the time stamp of the waypoint into seconds from the epoch 36 70 */ 71 public final static SimpleDateFormat GPXTIMEFMT = 72 new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); // ignore timezone 73 37 74 public void setTime() { 38 75 if (! attr.containsKey("time")) { 39 76 return; 40 77 } 41 SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); // ignore timezone 42 Date d = f.parse(attr.get("time").toString(), new ParsePosition(0)); 78 Date d = GPXTIMEFMT.parse(attr.get("time").toString(), new ParsePosition(0)); 43 79 if (d != null /* parsing ok */) { 44 80 time = d.getTime() / 1000.0; /* ms => seconds */ 45 81 }
