Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.awt.event.ActionEvent;
|
---|
7 |
|
---|
8 | import org.openstreetmap.josm.gui.MainApplication;
|
---|
9 | import 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 | */
|
---|
16 | public 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.