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

Last change on this file was 18682, checked in by Klumbumbus, 22 months ago

fix #22784, fix #22785, fix #22786 - Add context sensitive help links, patches by gaben

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