Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package cadastre_fr;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.marktr;
|
---|
5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
6 |
|
---|
7 | import java.awt.event.ActionEvent;
|
---|
8 |
|
---|
9 | import org.openstreetmap.josm.actions.JosmAction;
|
---|
10 |
|
---|
11 | @SuppressWarnings("serial")
|
---|
12 | public class MenuActionCancelGrab extends JosmAction {
|
---|
13 |
|
---|
14 | public static final String NAME = marktr("Cancel current grab");
|
---|
15 |
|
---|
16 | private WMSLayer wmsLayer;
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Constructs a new {@code MenuActionCancelGrab}.
|
---|
20 | * @param wmsLayer WMS layer
|
---|
21 | */
|
---|
22 | public MenuActionCancelGrab(WMSLayer wmsLayer) {
|
---|
23 | super(tr(NAME), null, tr("Cancel current grab (only vector images)"), null, false);
|
---|
24 | this.wmsLayer = wmsLayer;
|
---|
25 | }
|
---|
26 |
|
---|
27 | @Override
|
---|
28 | public void actionPerformed(ActionEvent arg0) {
|
---|
29 | if (wmsLayer.grabThread.getImagesToGrabSize() > 0) {
|
---|
30 | wmsLayer.grabThread.cancel();
|
---|
31 | }
|
---|
32 | }
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.