Ticket #1978: addTunePrefToGPXprefs.patch
File addTunePrefToGPXprefs.patch, 3.7 KB (added by , 16 years ago) |
---|
-
src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
old new 10 10 11 11 import javax.swing.BorderFactory; 12 12 import javax.swing.JCheckBox; 13 import javax.swing.JComboBox; 13 14 import javax.swing.JLabel; 14 15 import javax.swing.JTextField; 15 16 import javax.swing.JScrollPane; … … 26 27 private JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported.")); 27 28 private JCheckBox largeGpsPoints = new JCheckBox(tr("Draw large GPS points.")); 28 29 private JCheckBox colorTracks = new JCheckBox(tr("Color tracks by velocity.")); 30 private JComboBox colorTracksTune = new JComboBox(new String[] {tr("Car"), tr("Bicycle"), tr("Foot")}); 29 31 private JCheckBox directionHint = new JCheckBox(tr("Draw Direction Arrows")); 30 32 private JCheckBox drawGpsArrows = new JCheckBox(tr("Draw Direction Arrows")); 31 33 private JCheckBox drawGpsArrowsFast = new JCheckBox(tr("Fast drawing (looks uglier)")); … … 51 53 drawGpsArrowsFast.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled()); 52 54 drawGpsArrowsMinDist.setEnabled(drawGpsArrows.isSelected() && drawGpsArrows.isEnabled()); 53 55 colorTracks.setEnabled(drawRawGpsLines.isSelected()); 56 colorTracksTune.setEnabled(colorTracks.isSelected() && drawRawGpsLines.isSelected()); 54 57 } 55 58 }); 56 59 drawRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines")); … … 96 99 panel.add(drawGpsArrowsMinDist, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 97 100 98 101 // colorTracks 102 colorTracks.addActionListener(new ActionListener(){ 103 public void actionPerformed(ActionEvent e) { 104 colorTracksTune.setEnabled(colorTracks.isSelected() && drawRawGpsLines.isSelected()); 105 } 106 }); 99 107 colorTracks.setSelected(Main.pref.getBoolean("draw.rawgps.colors")); 100 108 colorTracks.setToolTipText(tr("Choose the hue for the track color by the velocity at that point.")); 101 109 colorTracks.setEnabled(drawRawGpsLines.isSelected()); 102 panel.add(colorTracks, GBC.eop().insets(40,0,0,0)); 103 110 panel.add(colorTracks, GBC.std().insets(40,0,0,0)); 111 112 // color Tracks by Velocity Tune 113 int ccts = Main.pref.getInteger("draw.rawgps.colorTracksTune", 45); 114 colorTracksTune.setSelectedIndex(ccts==10 ? 2 : (ccts==20 ? 1 : 0)); 115 colorTracksTune.setToolTipText(tr("Allows to tune the track coloring for different average speeds.")); 116 colorTracksTune.setEnabled(colorTracks.isSelected() && colorTracks.isEnabled()); 117 panel.add(colorTracksTune, GBC.eop().insets(5,0,0,5)); 118 104 119 // largeGpsPoints 105 120 largeGpsPoints.setSelected(Main.pref.getBoolean("draw.rawgps.large")); 106 121 largeGpsPoints.setToolTipText(tr("Draw larger dots for the GPS points.")); … … 173 188 Main.pref.put("draw.rawgps.alternatedirection", drawGpsArrowsFast.isSelected()); 174 189 Main.pref.put("draw.rawgps.min-arrow-distance", drawGpsArrowsMinDist.getText()); 175 190 Main.pref.put("draw.rawgps.colors", colorTracks.isSelected()); 191 int ccti=colorTracksTune.getSelectedIndex(); 192 Main.pref.putInteger("draw.rawgps.colorTracksTune", ccti==2 ? 10 : (ccti==1 ? 20 : 45)); 176 193 Main.pref.put("draw.rawgps.large", largeGpsPoints.isSelected()); 177 194 Main.pref.put("draw.segment.direction", directionHint.isSelected()); 178 195 Main.pref.put("draw.segment.relevant_directions_only", interestingDirections.isSelected());