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

Last change on this file since 24955 was 24934, checked in by pieren, 14 years ago

moved grab action to a thread

File size: 742 bytes
Line 
1package cadastre_fr;
2
3import static org.openstreetmap.josm.tools.I18n.tr;
4
5import java.awt.event.ActionEvent;
6
7import org.openstreetmap.josm.actions.JosmAction;
8
9@SuppressWarnings("serial")
10public class MenuActionCancelGrab extends JosmAction {
11
12 public static String name = "Cancel current grab";
13
14 private WMSLayer wmsLayer;
15
16 public MenuActionCancelGrab(WMSLayer wmsLayer) {
17 super(tr(name), null, tr("Cancel current grab (only vector images)"), null, false);
18 this.wmsLayer = wmsLayer;
19 }
20
21
22 @Override
23 public void actionPerformed(ActionEvent arg0) {
24 if (wmsLayer.grabThread.getImagesToGrabSize() > 0) {
25 wmsLayer.grabThread.cancel();
26 }
27 }
28
29}
Note: See TracBrowser for help on using the repository browser.