Ticket #1872: drawRawGpsMaxLineLengthLocal-200m.patch
File drawRawGpsMaxLineLengthLocal-200m.patch, 4.6 KB (added by , 16 years ago) |
---|
-
src/org/openstreetmap/josm/gui/layer/GpxLayer.java
395 395 // draw direction arrows on the lines 396 396 boolean direction = Main.pref.getBoolean("draw.rawgps.direction"); 397 397 // don't draw lines if longer than x meters 398 int maxLineLength = Main.pref.getInteger("draw.rawgps.max-line-length", -1); 398 int maxLineLength; 399 if (this.isLocalFile) { 400 maxLineLength = Main.pref.getInteger("draw.rawgps.max-line-length.local", -1); 401 } else { 402 maxLineLength = Main.pref.getInteger("draw.rawgps.max-line-length", 200); 403 } 399 404 // draw line between points, global setting 400 405 boolean lines = (Main.pref.getBoolean("draw.rawgps.lines") || (Main.pref.getBoolean("draw.rawgps.lines.localfiles") && this.isLocalFile)); 401 406 String linesKey = "draw.rawgps.lines.layer "+name; -
src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
32 32 private JRadioButton drawRawGpsLinesNone = new JRadioButton(tr("None")); 33 33 private ActionListener drawRawGpsLinesActionListener; 34 34 private JTextField drawRawGpsMaxLineLength = new JTextField(8); 35 private JTextField drawRawGpsMaxLineLengthLocal = new JTextField(8); 35 36 private JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported.")); 36 37 private JCheckBox largeGpsPoints = new JCheckBox(tr("Draw large GPS points.")); 37 38 private ButtonGroup colorGroup; … … 78 79 drawRawGpsLinesActionListener = new ActionListener(){ 79 80 public void actionPerformed(ActionEvent e) { 80 81 forceRawGpsLines.setEnabled(!drawRawGpsLinesNone.isSelected()); 81 drawRawGpsMaxLineLength.setEnabled(!drawRawGpsLinesNone.isSelected()); 82 drawRawGpsMaxLineLength.setEnabled(!(drawRawGpsLinesNone.isSelected() || drawRawGpsLinesLocal.isSelected())); 83 drawRawGpsMaxLineLengthLocal.setEnabled(!drawRawGpsLinesNone.isSelected()); 82 84 drawGpsArrows.setEnabled(!drawRawGpsLinesNone.isSelected() ); 83 85 drawGpsArrowsFast.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled()); 84 86 drawGpsArrowsMinDist.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled()); … … 89 91 drawRawGpsLinesLocal.addActionListener(drawRawGpsLinesActionListener); 90 92 drawRawGpsLinesAll.addActionListener(drawRawGpsLinesActionListener); 91 93 94 // drawRawGpsMaxLineLengthLocal 95 drawRawGpsMaxLineLengthLocal.setText(Integer.toString(Main.pref.getInteger("draw.rawgps.max-line-length.local", -1))); 96 drawRawGpsMaxLineLengthLocal.setToolTipText(tr("Maximum length (in meters) to draw lines for local files. Set to '-1' to draw all lines.")); 97 drawRawGpsMaxLineLengthLocal.setEnabled(!drawRawGpsLinesNone.isSelected()); 98 panel.add(new JLabel(tr("Maximum length for local files (meters)")), GBC.std().insets(40,0,0,0)); 99 panel.add(drawRawGpsMaxLineLengthLocal, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 100 92 101 // drawRawGpsMaxLineLength 93 drawRawGpsMaxLineLength.setText(Integer.toString(Main.pref.getInteger("draw.rawgps.max-line-length", -1)));102 drawRawGpsMaxLineLength.setText(Integer.toString(Main.pref.getInteger("draw.rawgps.max-line-length", 200))); 94 103 drawRawGpsMaxLineLength.setToolTipText(tr("Maximum length (in meters) to draw lines. Set to '-1' to draw all lines.")); 95 104 drawRawGpsMaxLineLength.setEnabled(!drawRawGpsLinesNone.isSelected()); 96 105 panel.add(new JLabel(tr("Maximum length (meters)")), GBC.std().insets(40,0,0,0)); … … 246 255 Main.pref.put("draw.rawgps.lines", drawRawGpsLinesAll.isSelected()); 247 256 Main.pref.put("draw.rawgps.lines.localfiles", drawRawGpsLinesLocal.isSelected()); 248 257 Main.pref.put("draw.rawgps.max-line-length", drawRawGpsMaxLineLength.getText()); 258 Main.pref.put("draw.rawgps.max-line-length.local", drawRawGpsMaxLineLengthLocal.getText()); 249 259 Main.pref.put("draw.rawgps.lines.force", forceRawGpsLines.isSelected()); 250 260 Main.pref.put("draw.rawgps.direction", drawGpsArrows.isSelected()); 251 261 Main.pref.put("draw.rawgps.alternatedirection", drawGpsArrowsFast.isSelected());