Ignore:
Timestamp:
2018-08-18T02:26:59+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysAction.java

    r33784 r34488  
    1010import java.util.Collection;
    1111
    12 import org.openstreetmap.josm.Main;
    1312import org.openstreetmap.josm.actions.JosmAction;
    1413import org.openstreetmap.josm.command.Command;
     14import org.openstreetmap.josm.data.UndoRedoHandler;
    1515import org.openstreetmap.josm.data.osm.DataSet;
    1616import org.openstreetmap.josm.data.osm.Node;
     
    5252
    5353        // c is the last command launched, if any
    54         Command c = !Main.main.undoRedo.commands.isEmpty() ? Main.main.undoRedo.commands
     54        Command c = !UndoRedoHandler.getInstance().commands.isEmpty() ? UndoRedoHandler.getInstance().commands
    5555                .getLast() : null;
    5656
     
    6969                    if (cmdAW.executable()) {
    7070                        // This will also trigger AlignWaysCmdKeepLength.executeCommand()
    71                         Main.main.undoRedo.add(cmdAW);
     71                        UndoRedoHandler.getInstance().add(cmdAW);
    7272                    }
    7373                }
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysCmdKeepAngles.java

    r33784 r34488  
    1111import javax.swing.JOptionPane;
    1212
    13 import org.openstreetmap.josm.Main;
    1413import org.openstreetmap.josm.data.coor.EastNorth;
    1514import org.openstreetmap.josm.data.osm.DataSet;
    1615import org.openstreetmap.josm.data.osm.Node;
    1716import org.openstreetmap.josm.data.osm.WaySegment;
     17import org.openstreetmap.josm.gui.MainApplication;
    1818
    1919import com.tilusnet.josm.plugins.alignways.geometry.AlignWaysGeomLine;
     
    211211
    212212        JOptionPane.showMessageDialog(
    213                 Main.parent,
     213                MainApplication.getMainFrame(),
    214214                tr(statMsg),
    215215                tr("AlignWayS: Alignment not possible"),
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysCmdKeepLength.java

    r33784 r34488  
    1515import javax.swing.JOptionPane;
    1616
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.command.Command;
    1918import org.openstreetmap.josm.data.coor.EastNorth;
     
    2221import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2322import org.openstreetmap.josm.data.osm.WaySegment;
     23import org.openstreetmap.josm.data.projection.ProjectionRegistry;
    2424import org.openstreetmap.josm.gui.MainApplication;
    2525import org.openstreetmap.josm.gui.MapView;
     
    253253        // Deny action if the nodes would end up outside world
    254254        for (EastNorth en : calculatedNodes.values()) {
    255             if (Main.getProjection().eastNorth2latlon(en).isOutSideWorld())
     255            if (ProjectionRegistry.getProjection().eastNorth2latlon(en).isOutSideWorld())
    256256                return AlignableStatus.ALGN_INV_OUTSIDE_WORLD;
    257257        }
     
    300300
    301301        JOptionPane.showMessageDialog(
    302                 Main.parent,
     302                MainApplication.getMainFrame(),
    303303                tr(statMsg),
    304304                tr("AlignWayS: Alignment not possible"),
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysMode.java

    r33784 r34488  
    1818import javax.swing.JOptionPane;
    1919
    20 import org.openstreetmap.josm.Main;
    2120import org.openstreetmap.josm.actions.mapmode.MapMode;
    2221import org.openstreetmap.josm.data.osm.DataSet;
     
    3433import org.openstreetmap.josm.gui.layer.Layer;
    3534import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     35import org.openstreetmap.josm.spi.preferences.Config;
    3636import org.openstreetmap.josm.tools.Shortcut;
    3737
     
    7676        }
    7777
    78         boolean showTips = Boolean.parseBoolean(Main.pref.get("alignways.showtips", "true"));
     78        boolean showTips = Boolean.parseBoolean(Config.getPref().get("alignways.showtips", "true"));
    7979        if ((showTips) && (!tipShown)) {
    8080            showTips();
    8181        }
    82         int majorVer = Integer.parseInt(Main.pref.get("alignways.majorver", "-1"));
     82        int majorVer = Integer.parseInt(Config.getPref().get("alignways.majorver", "-1"));
    8383        if (majorVer != AlignWaysPlugin.AlignWaysMajorVersion) {
    8484            showWhatsNew();
     
    224224                null, okButton, okButton[0]);
    225225        tipPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 30, 10));
    226         JDialog tipDialog = tipPane.createDialog(Main.parent, tr("AlignWays Tips"));
     226        JDialog tipDialog = tipPane.createDialog(MainApplication.getMainFrame(), tr("AlignWays Tips"));
    227227        tipDialog.setIconImage(new ImageIcon(getClass().getResource("/images/alignways.png")).getImage());
    228228
     
    233233        tipDialog.dispose();
    234234
    235         Main.pref.putBoolean("alignways.showtips", !atp.isChkBoxSelected());
     235        Config.getPref().putBoolean("alignways.showtips", !atp.isChkBoxSelected());
    236236    }
    237237
     
    241241        JOptionPane wnPane = new JOptionPane(awnp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null);
    242242        wnPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    243         JDialog wnDialog = wnPane.createDialog(Main.parent, tr("AlignWays: What''s New..."));
     243        JDialog wnDialog = wnPane.createDialog(MainApplication.getMainFrame(), tr("AlignWays: What''s New..."));
    244244        wnDialog.setIconImage(new ImageIcon(getClass().getResource("/images/alignways.png")).getImage());
    245245
     
    249249        wnDialog.dispose();
    250250
    251         Main.pref.put("alignways.majorver", Integer.toString(AlignWaysPlugin.AlignWaysMajorVersion));
     251        Config.getPref().put("alignways.majorver", Integer.toString(AlignWaysPlugin.AlignWaysMajorVersion));
    252252    }
    253253
  • applications/editors/josm/plugins/alignways/src/com/tilusnet/josm/plugins/alignways/AlignWaysSegmentMgr.java

    r33136 r34488  
    99import javax.swing.JOptionPane;
    1010
    11 import org.openstreetmap.josm.Main;
    1211import org.openstreetmap.josm.data.osm.Node;
    1312import org.openstreetmap.josm.data.osm.OsmPrimitive;
     13import org.openstreetmap.josm.gui.MainApplication;
    1414import org.openstreetmap.josm.gui.MapView;
    1515
     
    7676        }
    7777        else if (refSeg != null && tmpAlgnSeg.equals(refSeg)) {
    78             JOptionPane.showMessageDialog(Main.parent,
     78            JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    7979                    tr("Segment to be aligned cannot be the same with the reference segment.\n" +
    8080                    "Please choose a different segment to be aligned."),
     
    110110        }
    111111        else if (algnSeg != null && tmpRefSeg.equals(algnSeg)) {
    112             JOptionPane.showMessageDialog(Main.parent,
     112            JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    113113                    tr("Reference segment cannot be the same with the segment to be aligned.\n" +
    114114                    "Please choose a different reference segment."),
Note: See TracChangeset for help on using the changeset viewer.