Ignore:
Timestamp:
2024-04-22T20:59:26+02:00 (4 weeks ago)
Author:
taylor.smock
Message:

Revert most var changes from r19048, fix most new compile warnings and checkstyle issues

Also, document why various ErrorProne checks were originally disabled and fix
generic SonarLint issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapMover.java

    r17333 r19050  
    77import java.awt.Point;
    88import java.awt.event.ActionEvent;
     9import java.awt.event.InputEvent;
    910import java.awt.event.KeyEvent;
    1011import java.awt.event.MouseAdapter;
     
    8889                EastNorth center = nc.getCenter();
    8990                EastNorth newcenter = nc.getEastNorth(nc.getWidth()/2+nc.getWidth()/5, nc.getHeight()/2+nc.getHeight()/5);
    90                 switch(action) {
     91                switch (action) {
    9192                case "left":
    9293                    nc.zoomTo(new EastNorth(2*center.east()-newcenter.east(), center.north()));
     
    173174    @Override
    174175    public void mouseDragged(MouseEvent e) {
    175         int offMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK;
    176         boolean allowMovement = (e.getModifiersEx() & (MouseEvent.BUTTON3_DOWN_MASK | offMask)) == MouseEvent.BUTTON3_DOWN_MASK;
     176        int offMask = InputEvent.BUTTON1_DOWN_MASK | InputEvent.BUTTON2_DOWN_MASK;
     177        boolean allowMovement = (e.getModifiersEx() & (InputEvent.BUTTON3_DOWN_MASK | offMask)) == InputEvent.BUTTON3_DOWN_MASK;
    177178        if (PlatformManager.isPlatformOsx()) {
    178179            MapFrame map = MainApplication.getMap();
    179             int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK;
     180            int macMouseMask = InputEvent.CTRL_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK;
    180181            boolean macMovement = e.getModifiersEx() == macMouseMask;
    181182            boolean allowedMode = !map.mapModeSelect.equals(map.mapMode)
     
    204205    @Override
    205206    public void mousePressed(MouseEvent e) {
    206         int offMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK;
    207         int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK;
     207        int offMask = InputEvent.BUTTON1_DOWN_MASK | InputEvent.BUTTON2_DOWN_MASK;
     208        int macMouseMask = InputEvent.CTRL_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK;
    208209        if ((e.getButton() == MouseEvent.BUTTON3 && (e.getModifiersEx() & offMask) == 0) ||
    209210                (PlatformManager.isPlatformOsx() && e.getModifiersEx() == macMouseMask)) {
     
    253254    @Override
    254255    public void mouseWheelMoved(MouseWheelEvent e) {
    255         int rotation = PROP_ZOOM_REVERSE_WHEEL.get() ? -e.getWheelRotation() : e.getWheelRotation();
     256        int rotation = Boolean.TRUE.equals(PROP_ZOOM_REVERSE_WHEEL.get()) ? -e.getWheelRotation() : e.getWheelRotation();
    256257        nc.zoomManyTimes(e.getX(), e.getY(), rotation);
    257258    }
     
    268269        // Is only the selected mouse button pressed?
    269270        if (PlatformManager.isPlatformOsx()) {
    270             if (e.getModifiersEx() == MouseEvent.CTRL_DOWN_MASK) {
     271            if (e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK) {
    271272                doMoveForDrag(e);
    272273            } else {
Note: See TracChangeset for help on using the changeset viewer.