Changeset 33832 in osm for applications


Ignore:
Timestamp:
2017-11-17T21:30:21+01:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12630

Location:
applications/editors/josm/plugins/touchscreenhelper
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/touchscreenhelper/build.xml

    r32680 r33832  
    44    <property name="commit.message" value="JOSM/touchscreenhelper: Added T shortcut, hold T to activate temporarily"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="10580"/>
     6    <property name="plugin.main.version" value="12630"/>
    77    <property name="plugin.author" value="glebius@glebius.int.ru"/>
    88    <property name="plugin.class" value="touchscreenhelper.TouchScreenHelperPlugin"/>
  • applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/BrowseAction.java

    r32550 r33832  
    1010import java.awt.event.MouseMotionListener;
    1111
    12 import org.openstreetmap.josm.Main;
    1312import org.openstreetmap.josm.actions.mapmode.MapMode;
    1413import org.openstreetmap.josm.data.coor.EastNorth;
     14import org.openstreetmap.josm.gui.MainApplication;
    1515import org.openstreetmap.josm.gui.MapFrame;
    1616import org.openstreetmap.josm.tools.Shortcut;
     
    2222    private TimedKeyReleaseListener listener;
    2323
    24     public BrowseAction(MapFrame mapFrame) {
     24    public BrowseAction() {
    2525        super(tr("Browse"), "browse", tr("Browse map with left button"),
    2626            Shortcut.registerShortcut("touchscreenhelper:browse", tr("Mode: {0}", tr("Browse map with left button")),
    2727                KeyEvent.VK_T, Shortcut.DIRECT),
    28             mapFrame, Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
     28            Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
    2929        MapFrame.addMapModeChangeListener(this);
    3030    }
     
    3737    @Override public void enterMode() {
    3838        super.enterMode();
    39         Main.map.mapView.addMouseListener(this);
    40         Main.map.mapView.addMouseMotionListener(this);
     39        MainApplication.getMap().mapView.addMouseListener(this);
     40        MainApplication.getMap().mapView.addMouseMotionListener(this);
    4141
    4242        listener = new TimedKeyReleaseListener() {
     
    4545                if (evt.getKeyCode() == getShortcut().getKeyStroke().getKeyCode()) {
    4646                    if (oldMapMode != null && !(oldMapMode instanceof BrowseAction))
    47                     Main.map.selectMapMode(oldMapMode);
     47                    MainApplication.getMap().selectMapMode(oldMapMode);
    4848                }
    4949            }
     
    5454        super.exitMode();
    5555
    56         Main.map.mapView.removeMouseListener(this);
    57         Main.map.mapView.removeMouseMotionListener(this);
     56        MainApplication.getMap().mapView.removeMouseListener(this);
     57        MainApplication.getMap().mapView.removeMouseMotionListener(this);
    5858        listener.stop();
    5959    }
     
    6969        if (mousePosMove == null)
    7070            startMovement(e);
    71         EastNorth center = Main.map.mapView.getCenter();
    72         EastNorth mouseCenter = Main.map.mapView.getEastNorth(e.getX(), e.getY());
    73         Main.map.mapView.zoomTo(new EastNorth(
     71        EastNorth center = MainApplication.getMap().mapView.getCenter();
     72        EastNorth mouseCenter = MainApplication.getMap().mapView.getEastNorth(e.getX(), e.getY());
     73        MainApplication.getMap().mapView.zoomTo(new EastNorth(
    7474            mousePosMove.east() + center.east() - mouseCenter.east(),
    7575            mousePosMove.north() + center.north() - mouseCenter.north()));
     
    9393            return;
    9494        movementInPlace = true;
    95         mousePosMove = Main.map.mapView.getEastNorth(e.getX(), e.getY());
     95        mousePosMove = MainApplication.getMap().mapView.getEastNorth(e.getX(), e.getY());
    9696    }
    9797
  • applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/TimedKeyReleaseListener.java

    r32550 r33832  
    1515import javax.swing.Timer;
    1616
    17 import org.openstreetmap.josm.Main;
     17import org.openstreetmap.josm.tools.Logging;
    1818
    1919public class TimedKeyReleaseListener implements AWTEventListener {
    20     private final TreeSet<Integer> set = new TreeSet<Integer>();
     20    private final TreeSet<Integer> set = new TreeSet<>();
    2121    private Timer timer;
    2222    protected KeyEvent releaseEvent;
     
    3737                    AWTEvent.KEY_EVENT_MASK);
    3838        } catch (SecurityException ex) {
    39             Main.error(ex);
     39            Logging.error(ex);
    4040        }
    4141    }
     
    6767            Toolkit.getDefaultToolkit().removeAWTEventListener(this);
    6868        } catch (SecurityException ex) {
    69             Main.error(ex);
     69            Logging.error(ex);
    7070        }
    7171    }
  • applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/TouchScreenHelperPlugin.java

    r32550 r33832  
    22package touchscreenhelper;
    33
    4 import org.openstreetmap.josm.Main;
    54import org.openstreetmap.josm.gui.IconToggleButton;
    65import org.openstreetmap.josm.gui.MapFrame;
     
    1413
    1514    @Override
    16     public void mapFrameInitialized(MapFrame oldFrame,
    17         MapFrame newFrame) {
     15    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    1816        if (oldFrame == null && newFrame != null) {
    19             Main.map.addMapMode(new IconToggleButton(new BrowseAction(Main.map)));
     17            newFrame.addMapMode(new IconToggleButton(new BrowseAction()));
    2018        }
    2119    }
Note: See TracChangeset for help on using the changeset viewer.