Ticket #3222: 2.diff
| File 2.diff, 4.7 KB (added by , 16 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/layer/GpxLayer.java
439 439 } 440 440 // paint large dots for points 441 441 boolean large = Main.pref.getBoolean("draw.rawgps.large"); 442 boolean hdopcircle = Main.pref.getBoolean("draw.rawgps.hdopcircle", true); 442 443 // color the lines 443 444 colorModes colored = colorModes.none; 444 445 try { … … 631 632 } // end for trk 632 633 } // end if lines 633 634 635 634 636 /**************************************************************** 635 ********** STEP 3d - DRAW LARGE POINTS *************************637 ********** STEP 3d - DRAW LARGE POINTS AND HDOP CIRCLE ********* 636 638 ****************************************************************/ 637 if (large ) {639 if (large || hdopcircle) { 638 640 g.setColor(neutralColor); 639 641 for (GpxTrack trk : data.tracks) { 640 642 for (Collection<WayPoint> segment : trk.trackSegs) { … … 645 647 } 646 648 Point screen = mv.getPoint(trkPnt.getEastNorth()); 647 649 g.setColor(trkPnt.customColoring); 648 g.fillRect(screen.x - 1, screen.y - 1, 3, 3); 650 if (hdopcircle && trkPnt.attr.get("hdop") != null) { 651 // hdop value 652 float hdop = ((Float)trkPnt.attr.get("hdop")).floatValue(); 653 if (hdop < 0) { 654 hdop = 0; 655 } 656 // hdop pixels 657 int hdopp = mv.getPoint(new LatLon(trkPnt.getCoor().lat(), trkPnt.getCoor().lon() + 2*6*hdop*360/40000000)).x - screen.x; 658 g.drawArc(screen.x-hdopp/2, screen.y-hdopp/2, hdopp, hdopp, 0, 360); 659 } 660 if (large) { 661 g.fillRect(screen.x-1, screen.y-1, 3, 3); 662 } 649 663 } // end for trkpnt 650 664 } // end for segment 651 665 } // end for trk 652 } // end if large 666 } // end if large || hdopcircle 653 667 654 668 /**************************************************************** 655 669 ********** STEP 3e - DRAW SMALL POINTS FOR LINES *************** -
src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
41 41 private JTextField drawRawGpsMaxLineLengthLocal = new JTextField(8); 42 42 private JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported.")); 43 43 private JCheckBox largeGpsPoints = new JCheckBox(tr("Draw large GPS points.")); 44 private JCheckBox hdopCircleGpsPoints = new JCheckBox(tr("Draw a circle form HDOP value.")); 44 45 private ButtonGroup colorGroup; 45 46 private JRadioButton colorTypeVelocity = new JRadioButton(tr("Velocity (red = slow, green = fast)")); 46 47 private JRadioButton colorTypeDilution = new JRadioButton(tr("Dilution of Position (red = high, green = low, if available)")); … … 143 144 panel.add(new JLabel(tr("Minimum distance (pixels)")), GBC.std().insets(60,0,0,0)); 144 145 panel.add(drawGpsArrowsMinDist, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 145 146 147 // hdopCircleGpsPoints 148 hdopCircleGpsPoints.setSelected(Main.pref.getBoolean("draw.rawgps.hdopcircle", true)); 149 hdopCircleGpsPoints.setToolTipText(tr("Draw a circle form HDOP value.")); 150 panel.add(hdopCircleGpsPoints, GBC.eop().insets(20,0,0,0)); 151 146 152 // largeGpsPoints 147 153 largeGpsPoints.setSelected(Main.pref.getBoolean("draw.rawgps.large", false)); 148 154 largeGpsPoints.setToolTipText(tr("Draw larger dots for the GPS points.")); … … 275 281 Main.pref.putInteger("draw.rawgps.colors", 0); 276 282 int ccti=colorTypeVelocityTune.getSelectedIndex(); 277 283 Main.pref.putInteger("draw.rawgps.colorTracksTune", ccti==2 ? 10 : (ccti==1 ? 20 : 45)); 284 Main.pref.put("draw.rawgps.hdopcircle", hdopCircleGpsPoints.isSelected()); 278 285 Main.pref.put("draw.rawgps.large", largeGpsPoints.isSelected()); 279 286 Main.pref.put("draw.segment.direction", directionHint.isSelected()); 280 287 Main.pref.put("draw.segment.relevant_directions_only", interestingDirections.isSelected());
