source: osm/applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionCancelGrab.java@ 33514

Last change on this file since 33514 was 33047, checked in by donvip, 9 years ago

findbugs

File size: 961 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package cadastre_fr;
3
4import static org.openstreetmap.josm.tools.I18n.marktr;
5import static org.openstreetmap.josm.tools.I18n.tr;
6
7import java.awt.event.ActionEvent;
8
9import org.openstreetmap.josm.actions.JosmAction;
10
11@SuppressWarnings("serial")
12public 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.