source: josm/trunk/src/org/openstreetmap/josm/actions/DrawBoundariesOfDownloadedDataAction.java@ 14932

Last change on this file since 14932 was 14648, checked in by simon04, 5 years ago

fix #17067 - Duplicate settings for display of hatching area

File size: 1.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.event.ActionEvent;
7
8import org.openstreetmap.josm.gui.MainApplication;
9import org.openstreetmap.josm.gui.preferences.display.DrawingPreference;
10
11/**
12 * This class toggles whether to draw boundaries of downloaded data.
13 *
14 * @since 14648
15 */
16public class DrawBoundariesOfDownloadedDataAction extends PreferenceToggleAction {
17
18 /**
19 * Constructs a new {@link DrawBoundariesOfDownloadedDataAction}.
20 */
21 public DrawBoundariesOfDownloadedDataAction() {
22 super(tr("Draw boundaries of downloaded data"),
23 tr("Enable/disable hatched background rendering of areas outside of the downloaded areas."),
24 DrawingPreference.SOURCE_BOUNDS_PROP.getKey(),
25 DrawingPreference.SOURCE_BOUNDS_PROP.getDefaultValue()
26 );
27 }
28
29 @Override
30 protected void updateEnabledState() {
31 setEnabled(MainApplication.getLayerManager().getEditLayer() != null);
32 }
33
34 @Override
35 public void actionPerformed(ActionEvent e) {
36 super.actionPerformed(e);
37 if (MainApplication.isDisplayingMapView()) {
38 MainApplication.getMap().mapView.repaint();
39 }
40 }
41
42}
Note: See TracBrowser for help on using the repository browser.