Changeset 1577 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-05-05T17:39:15+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r1519 r1577 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)); -
trunk/src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
r1519 r1577 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.")); … … 63 64 gpsLinesGroup.add(drawRawGpsLinesAll); 64 65 65 if(Main.pref.getBoolean("draw.rawgps.lines")) { 66 /* ensure that default is in data base */ 67 Boolean lf = Main.pref.getBoolean("draw.rawgps.lines.localfiles", false); 68 if(Main.pref.getBoolean("draw.rawgps.lines", true)) 66 69 drawRawGpsLinesAll.setSelected(true); 67 } else if (Main.pref.getBoolean("draw.rawgps.lines.localfiles")) {70 else if (lf) 68 71 drawRawGpsLinesLocal.setSelected(true); 69 } else {72 else 70 73 drawRawGpsLinesNone.setSelected(true); 71 }72 74 73 75 panel.add(new JLabel(tr("Draw lines between raw GPS points")), GBC.eol().insets(20,0,0,0)); … … 79 81 public void actionPerformed(ActionEvent e) { 80 82 forceRawGpsLines.setEnabled(!drawRawGpsLinesNone.isSelected()); 81 drawRawGpsMaxLineLength.setEnabled(!drawRawGpsLinesNone.isSelected()); 83 drawRawGpsMaxLineLength.setEnabled(!(drawRawGpsLinesNone.isSelected() || drawRawGpsLinesLocal.isSelected())); 84 drawRawGpsMaxLineLengthLocal.setEnabled(!drawRawGpsLinesNone.isSelected()); 82 85 drawGpsArrows.setEnabled(!drawRawGpsLinesNone.isSelected() ); 83 86 drawGpsArrowsFast.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled()); … … 90 93 drawRawGpsLinesAll.addActionListener(drawRawGpsLinesActionListener); 91 94 95 // drawRawGpsMaxLineLengthLocal 96 drawRawGpsMaxLineLengthLocal.setText(Integer.toString(Main.pref.getInteger("draw.rawgps.max-line-length.local", -1))); 97 drawRawGpsMaxLineLengthLocal.setToolTipText(tr("Maximum length (in meters) to draw lines for local files. Set to '-1' to draw all lines.")); 98 drawRawGpsMaxLineLengthLocal.setEnabled(!drawRawGpsLinesNone.isSelected()); 99 panel.add(new JLabel(tr("Maximum length for local files (meters)")), GBC.std().insets(40,0,0,0)); 100 panel.add(drawRawGpsMaxLineLengthLocal, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 101 92 102 // drawRawGpsMaxLineLength 93 drawRawGpsMaxLineLength.setText(Integer.toString(Main.pref.getInteger("draw.rawgps.max-line-length", -1)));103 drawRawGpsMaxLineLength.setText(Integer.toString(Main.pref.getInteger("draw.rawgps.max-line-length", 200))); 94 104 drawRawGpsMaxLineLength.setToolTipText(tr("Maximum length (in meters) to draw lines. Set to '-1' to draw all lines.")); 95 105 drawRawGpsMaxLineLength.setEnabled(!drawRawGpsLinesNone.isSelected()); … … 99 109 // forceRawGpsLines 100 110 forceRawGpsLines.setToolTipText(tr("Force drawing of lines if the imported data contain no line information.")); 101 forceRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines.force" ));111 forceRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines.force", false)); 102 112 forceRawGpsLines.setEnabled(!drawRawGpsLinesNone.isSelected()); 103 113 panel.add(forceRawGpsLines, GBC.eop().insets(40,0,0,0)); … … 111 121 }); 112 122 drawGpsArrows.setToolTipText(tr("Draw direction arrows for lines, connecting GPS points.")); 113 drawGpsArrows.setSelected(Main.pref.getBoolean("draw.rawgps.direction" ));123 drawGpsArrows.setSelected(Main.pref.getBoolean("draw.rawgps.direction", false)); 114 124 drawGpsArrows.setEnabled(!drawRawGpsLinesNone.isSelected()); 115 125 panel.add(drawGpsArrows, GBC.eop().insets(40,0,0,0)); … … 117 127 // drawGpsArrowsFast 118 128 drawGpsArrowsFast.setToolTipText(tr("Draw the direction arrows using table lookups instead of complex math.")); 119 drawGpsArrowsFast.setSelected(Main.pref.getBoolean("draw.rawgps.alternatedirection" ));129 drawGpsArrowsFast.setSelected(Main.pref.getBoolean("draw.rawgps.alternatedirection", false)); 120 130 drawGpsArrowsFast.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled()); 121 131 panel.add(drawGpsArrowsFast, GBC.eop().insets(60,0,0,0)); … … 129 139 130 140 // largeGpsPoints 131 largeGpsPoints.setSelected(Main.pref.getBoolean("draw.rawgps.large" ));141 largeGpsPoints.setSelected(Main.pref.getBoolean("draw.rawgps.large", false)); 132 142 largeGpsPoints.setToolTipText(tr("Draw larger dots for the GPS points.")); 133 143 panel.add(largeGpsPoints, GBC.eop().insets(20,0,0,0)); … … 247 257 Main.pref.put("draw.rawgps.lines.localfiles", drawRawGpsLinesLocal.isSelected()); 248 258 Main.pref.put("draw.rawgps.max-line-length", drawRawGpsMaxLineLength.getText()); 259 Main.pref.put("draw.rawgps.max-line-length.local", drawRawGpsMaxLineLengthLocal.getText()); 249 260 Main.pref.put("draw.rawgps.lines.force", forceRawGpsLines.isSelected()); 250 261 Main.pref.put("draw.rawgps.direction", drawGpsArrows.isSelected());
Note:
See TracChangeset
for help on using the changeset viewer.