Changeset 11508 in josm for trunk/src/org
- Timestamp:
- 2017-01-29T04:29:01+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
r11483 r11508 7 7 import java.awt.Color; 8 8 import java.awt.Component; 9 import java.awt.Dimension; 9 10 import java.awt.GridBagLayout; 10 11 import java.awt.event.ActionListener; … … 281 282 282 283 colorTypeHeatMapTune.addPropertyChangeListener(e -> { 283 // get image size of environment 284 final int iconSize = (int) colorTypeHeatMapTune.getPreferredSize().getHeight(); 285 // ask the GPX draw for the correct color of that layer 286 final Color color = GpxDrawHelper.DEFAULT_COLOR.getChildColor(layerName != null ? layerName : "").get(); 287 colorTypeHeatIconLabel.setIcon(GpxDrawHelper.getColorMapImageIcon(color, colorTypeHeatMapTune.getSelectedIndex(), iconSize)); 284 final Dimension dim = colorTypeHeatMapTune.getPreferredSize(); 285 if (null != dim) { 286 // get image size of environment 287 final int iconSize = (int) dim.getHeight(); 288 final Color color; 289 // ask the GPX draw for the correct color of that layer ( if there is one ) 290 if (null != layerName) { 291 color = GpxDrawHelper.DEFAULT_COLOR.getChildColor(layerName).get(); 292 } else { 293 color = GpxDrawHelper.DEFAULT_COLOR.getDefaultValue(); 294 } 295 colorTypeHeatIconLabel.setIcon(GpxDrawHelper.getColorMapImageIcon(color, colorTypeHeatMapTune.getSelectedIndex(), iconSize)); 296 } 288 297 }); 289 298
Note:
See TracChangeset
for help on using the changeset viewer.