Changeset 11431 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
- Timestamp:
- 2017-01-06T20:26:55+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
r11039 r11431 56 56 private final JRadioButton colorTypeDilution = new JRadioButton(tr("Dilution of Position (red = high, green = low, if available)")); 57 57 private final JRadioButton colorTypeTime = new JRadioButton(tr("Track date")); 58 private final JRadioButton colorTypeHeatMap = new JRadioButton(tr("Heat Map (dark = few tracks, bright = many tracks)")); 58 59 private final JRadioButton colorTypeNone = new JRadioButton(tr("Single Color (can be customized for named layers)")); 59 60 private final JRadioButton colorTypeGlobal = new JRadioButton(tr("Use global settings")); 60 61 private final JosmComboBox<String> colorTypeVelocityTune = new JosmComboBox<>(new String[] {tr("Car"), tr("Bicycle"), tr("Foot")}); 62 private final JosmComboBox<String> colorTypeHeatMapTune = new JosmComboBox<>(new String[] {tr("User"), tr("Inferno"), tr("Viridis"), 63 tr("Wood"), tr("Heat")}); 61 64 private final JCheckBox makeAutoMarkers = new JCheckBox(tr("Create markers when reading GPX")); 62 65 private final JCheckBox drawGpsArrows = new JCheckBox(tr("Draw Direction Arrows")); … … 69 72 private final JosmTextField audioWaypointLabelPattern = new JosmTextField(); 70 73 private final JCheckBox useGpsAntialiasing = new JCheckBox(tr("Smooth GPX graphics (antialiasing)")); 74 private final JCheckBox drawLineWithAlpha = new JCheckBox(tr("Draw with Opacity (alpha blending) ")); 71 75 72 76 private String layerName; … … 180 184 }); 181 185 drawGpsArrows.setToolTipText(tr("Draw direction arrows for lines, connecting GPS points.")); 182 add(drawGpsArrows, GBC.eop().insets( 40, 0, 0, 0));186 add(drawGpsArrows, GBC.eop().insets(20, 0, 0, 0)); 183 187 184 188 // drawGpsArrowsFast 185 189 drawGpsArrowsFast.setToolTipText(tr("Draw the direction arrows using table lookups instead of complex math.")); 186 add(drawGpsArrowsFast, GBC.eop().insets( 60, 0, 0, 0));190 add(drawGpsArrowsFast, GBC.eop().insets(40, 0, 0, 0)); 187 191 ExpertToggleAction.addVisibilitySwitcher(drawGpsArrowsFast); 188 192 189 193 // drawGpsArrowsMinDist 190 194 drawGpsArrowsMinDist.setToolTipText(tr("Do not draw arrows if they are not at least this distance away from the last one.")); 191 add(new JLabel(tr("Minimum distance (pixels)")), GBC.std().insets( 60, 0, 0, 0));195 add(new JLabel(tr("Minimum distance (pixels)")), GBC.std().insets(40, 0, 0, 0)); 192 196 add(drawGpsArrowsMinDist, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 5)); 193 197 … … 210 214 add(useGpsAntialiasing, GBC.eop().insets(20, 0, 0, 0)); 211 215 ExpertToggleAction.addVisibilitySwitcher(useGpsAntialiasing); 216 217 // alpha blending 218 drawLineWithAlpha.setToolTipText(tr("Apply dynamic alpha-blending and adjust width based on zoom level for all GPX lines.")); 219 add(drawLineWithAlpha, GBC.eop().insets(20, 0, 0, 0)); 220 ExpertToggleAction.addVisibilitySwitcher(drawLineWithAlpha); 212 221 213 222 // colorTracks … … 221 230 colorGroup.add(colorTypeDilution); 222 231 colorGroup.add(colorTypeTime); 232 colorGroup.add(colorTypeHeatMap); 223 233 224 234 colorTypeVelocity.addChangeListener(e -> { … … 226 236 colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected()); 227 237 }); 238 239 colorTypeHeatMap.addChangeListener(e -> { 240 colorTypeHeatMapTune.setEnabled(colorTypeHeatMap.isSelected()); 241 colorDynamic.setEnabled(false); 242 }); 243 228 244 colorTypeDilution.addChangeListener(e -> colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected())); 229 245 … … 234 250 tr("Colors points and track segments by dilution of position (HDOP). Your capture device needs to log that information.")); 235 251 colorTypeTime.setToolTipText(tr("Colors points and track segments by its timestamp.")); 252 colorTypeHeatMap.setToolTipText(tr("Collected points and track segments for a position and displayed as heat map.")); 236 253 237 254 // color Tracks by Velocity Tune 238 255 colorTypeVelocityTune.setToolTipText(tr("Allows to tune the track coloring for different average speeds.")); 256 257 colorTypeHeatMapTune.setToolTipText(tr("Selects the color schema for heat map.")); 239 258 240 259 add(Box.createVerticalGlue(), GBC.eol().insets(0, 20, 0, 0)); … … 250 269 add(colorTypeDilution, GBC.eol().insets(40, 0, 0, 0)); 251 270 add(colorTypeTime, GBC.eol().insets(40, 0, 0, 0)); 271 add(colorTypeHeatMap, GBC.std().insets(40, 0, 0, 0)); 272 add(colorTypeHeatMapTune, GBC.eop().insets(5, 0, 0, 5)); 273 252 274 ExpertToggleAction.addVisibilitySwitcher(colorTypeDirection); 253 275 ExpertToggleAction.addVisibilitySwitcher(colorTypeDilution); … … 316 338 drawRawGpsMaxLineLength.setText(Integer.toString(Main.pref.getInteger("draw.rawgps.max-line-length", layerName, 200))); 317 339 drawLineWidth.setText(Integer.toString(Main.pref.getInteger("draw.rawgps.linewidth", layerName, 0))); 340 drawLineWithAlpha.setSelected(Main.pref.getBoolean("draw.rawgps.lines.alpha-blend", layerName, false)); 318 341 forceRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines.force", layerName, false)); 319 342 drawGpsArrows.setSelected(Main.pref.getBoolean("draw.rawgps.direction", layerName, false)); … … 323 346 largeGpsPoints.setSelected(Main.pref.getBoolean("draw.rawgps.large", layerName, false)); 324 347 useGpsAntialiasing.setSelected(Main.pref.getBoolean("mappaint.gpx.use-antialiasing", false)); 348 325 349 drawRawGpsLinesActionListener.actionPerformed(null); 326 350 … … 337 361 case 3: colorTypeDirection.setSelected(true); break; 338 362 case 4: colorTypeTime.setSelected(true); break; 363 case 5: colorTypeHeatMap.setSelected(true); break; 339 364 default: Main.warn("Unknown color type: " + colorType); 340 365 } … … 342 367 colorTypeVelocityTune.setSelectedIndex(ccts == 10 ? 2 : (ccts == 20 ? 1 : 0)); 343 368 colorTypeVelocityTune.setEnabled(colorTypeVelocity.isSelected() && colorTypeVelocity.isEnabled()); 369 370 colorTypeHeatMapTune.setSelectedIndex(Main.pref.getInteger("draw.rawgps.heatmap.colormap", layerName, 0)); 371 colorTypeHeatMapTune.setEnabled(colorTypeHeatMap.isSelected() && colorTypeHeatMap.isEnabled()); 372 344 373 colorDynamic.setSelected(Main.pref.getBoolean("draw.rawgps.colors.dynamic", layerName, false)); 345 374 colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected()); … … 386 415 Main.pref.put("draw.rawgps.large"+layerNameDot, largeGpsPoints.isSelected()); 387 416 Main.pref.put("draw.rawgps.linewidth"+layerNameDot, drawLineWidth.getText()); 417 Main.pref.put("draw.rawgps.lines.alpha-blend"+layerNameDot, drawLineWithAlpha.isSelected()); 418 388 419 Main.pref.put("mappaint.gpx.use-antialiasing", useGpsAntialiasing.isSelected()); 389 420 … … 404 435 } else if (colorTypeTime.isSelected()) { 405 436 Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 4); 437 } else if (colorTypeHeatMap.isSelected()) { 438 Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 5); 406 439 } else { 407 440 Main.pref.putInteger("draw.rawgps.colors"+layerNameDot, 0); … … 410 443 int ccti = colorTypeVelocityTune.getSelectedIndex(); 411 444 Main.pref.putInteger("draw.rawgps.colorTracksTune"+layerNameDot, ccti == 2 ? 10 : (ccti == 1 ? 20 : 45)); 445 446 Main.pref.putInteger("draw.rawgps.heatmap.colormap"+layerNameDot, colorTypeHeatMapTune.getSelectedIndex()); 447 412 448 return false; 413 449 }
Note:
See TracChangeset
for help on using the changeset viewer.