Last change
on this file since 16770 was 16529, checked in by simon04, 4 years ago |
PreferenceToggleAction: accept BooleanProperty in constructor
|
File size:
1.3 KB
|
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
|
---|
25 | );
|
---|
26 | }
|
---|
27 |
|
---|
28 | @Override
|
---|
29 | protected boolean listenToSelectionChange() {
|
---|
30 | return false;
|
---|
31 | }
|
---|
32 |
|
---|
33 | @Override
|
---|
34 | protected void updateEnabledState() {
|
---|
35 | setEnabled(MainApplication.getLayerManager().getEditLayer() != null);
|
---|
36 | }
|
---|
37 |
|
---|
38 | @Override
|
---|
39 | public void actionPerformed(ActionEvent e) {
|
---|
40 | super.actionPerformed(e);
|
---|
41 | if (MainApplication.isDisplayingMapView()) {
|
---|
42 | MainApplication.getMap().mapView.repaint();
|
---|
43 | }
|
---|
44 | }
|
---|
45 |
|
---|
46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.