Last change
on this file since 6672 was 5460, checked in by Don-vip, 12 years ago |
global use of Main.isDisplayingMapView()
|
File size:
973 bytes
|
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 org.openstreetmap.josm.Main;
|
---|
7 | import org.openstreetmap.josm.actions.mapmode.MapMode;
|
---|
8 |
|
---|
9 | public class LassoModeAction extends MapMode {
|
---|
10 |
|
---|
11 | public LassoModeAction() {
|
---|
12 | super(tr("Lasso Mode"),
|
---|
13 | "rope",
|
---|
14 | tr("Lasso selection mode: select objects within a hand-drawn region"),
|
---|
15 | null,
|
---|
16 | null);
|
---|
17 | }
|
---|
18 |
|
---|
19 | @Override
|
---|
20 | public void enterMode() {
|
---|
21 | if (Main.isDisplayingMapView()) {
|
---|
22 | Main.map.mapModeSelect.setLassoMode(true);
|
---|
23 | Main.map.mapModeSelect.enterMode();
|
---|
24 | }
|
---|
25 | super.enterMode();
|
---|
26 | }
|
---|
27 |
|
---|
28 | @Override
|
---|
29 | public void exitMode() {
|
---|
30 | if (Main.isDisplayingMapView()) {
|
---|
31 | Main.map.mapModeSelect.setLassoMode(false);
|
---|
32 | Main.map.mapModeSelect.exitMode();
|
---|
33 | }
|
---|
34 | super.exitMode();
|
---|
35 | }
|
---|
36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.