Changeset 14387 in josm
- Timestamp:
- 2018-10-30T22:51:22+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityAction.java
r14248 r14387 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.tools.I18n.trc; 5 6 6 7 import java.awt.BorderLayout; … … 15 16 import java.util.ArrayList; 16 17 import java.util.Collection; 18 import java.util.Dictionary; 17 19 import java.util.HashMap; 20 import java.util.Hashtable; 18 21 import java.util.List; 19 22 import java.util.function.Supplier; … … 248 251 249 252 slider.addChangeListener(e -> onStateChanged()); 253 254 //final NumberFormat format = DecimalFormat.getInstance(); 255 //setLabels(format.format(minValue), format.format((minValue + maxValue) / 2), format.format(maxValue)); 256 } 257 258 protected void setLabels(String labelMinimum, String labelMiddle, String labelMaximum) { 259 final Dictionary<Integer, JLabel> labels = new Hashtable<>(); 260 labels.put(slider.getMinimum(), new JLabel(labelMinimum)); 261 labels.put((slider.getMaximum() + slider.getMinimum()) / 2, new JLabel(labelMiddle)); 262 labels.put(slider.getMaximum(), new JLabel(labelMaximum)); 263 slider.setLabelTable(labels); 264 slider.setPaintLabels(true); 250 265 } 251 266 … … 334 349 class OpacitySlider extends AbstractFilterSlider<Layer> { 335 350 /** 336 * Crea ate a new {@link OpacitySlider}.351 * Create a new {@link OpacitySlider}. 337 352 */ 338 353 OpacitySlider() { 339 354 super(0, 1, Layer.class); 355 setLabels("0%", "50%", "100%"); 340 356 slider.setToolTipText(tr("Adjust opacity of the layer.")); 341 357 } … … 410 426 GammaFilterSlider() { 411 427 super(-1, 1, ImageryLayer.class); 428 setLabels("0", "1", "∞"); 412 429 slider.setToolTipText(tr("Adjust gamma value of the layer.")); 413 430 } … … 469 486 SharpnessSlider() { 470 487 super(0, MAX_SHARPNESS_FACTOR, ImageryLayer.class); 488 setLabels(trc("image sharpness", "blurred"), trc("image sharpness", "normal"), trc("image sharpness", "sharp")); 471 489 slider.setToolTipText(tr("Adjust sharpness/blur value of the layer.")); 472 490 } … … 506 524 ColorfulnessSlider() { 507 525 super(0, MAX_COLORFUL_FACTOR, ImageryLayer.class); 526 setLabels(trc("image colorfulness", "less"), trc("image colorfulness", "normal"), trc("image colorfulness", "more")); 508 527 slider.setToolTipText(tr("Adjust colorfulness of the layer.")); 509 528 }
Note:
See TracChangeset
for help on using the changeset viewer.