Changeset 34564 in osm for applications


Ignore:
Timestamp:
2018-08-18T20:33:13+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/tracer2
Files:
6 edited

Legend:

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

    r34344 r34564  
    55    <property name="commit.message" value="see #josm11090"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="13910"/>
     7    <property name="plugin.main.version" value="14153"/>
    88
    99    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/TracerAction.java

    r33700 r34564  
    2121import javax.swing.JOptionPane;
    2222
    23 import org.openstreetmap.josm.Main;
    2423import org.openstreetmap.josm.actions.mapmode.MapMode;
    2524import org.openstreetmap.josm.command.ChangePropertyCommand;
    2625import org.openstreetmap.josm.command.Command;
    2726import org.openstreetmap.josm.command.SequenceCommand;
     27import org.openstreetmap.josm.data.UndoRedoHandler;
    2828import org.openstreetmap.josm.data.coor.LatLon;
    2929import org.openstreetmap.josm.data.osm.Node;
     
    9999
    100100            if (!commands.isEmpty()) {
    101                 Main.main.undoRedo.add(new SequenceCommand(tr("Change tag {0} to {1}", strTag, strTagValue), commands));
     101                UndoRedoHandler.getInstance().add(new SequenceCommand(tr("Change tag {0} to {1}", strTag, strTagValue), commands));
    102102            }
    103103        }
     
    206206            }
    207207            if (oGetVersion.m_nVersionMajor != nMajor) {
    208                 JOptionPane.showMessageDialog(Main.parent,
     208                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    209209                        tr("The Tracer2Server version isn''t compatible with this plugin. Please download version {0} from\n{1}.", nMajor + ".x",
    210210                                "http://sourceforge.net/projects/tracer2server/"), tr("Error"), JOptionPane.ERROR_MESSAGE);
     
    212212            }
    213213            if (oGetVersion.m_nVersionMinor < nMinor) {
    214                 JOptionPane.showMessageDialog(Main.parent,
     214                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    215215                        tr("New version of Tracer2Server is available. For best results please upgrade to version {0}.", nMajor + "." + nMinor),
    216216                        tr("Information"), JOptionPane.INFORMATION_MESSAGE);
     
    232232            if (listEnableParam == null || listEnableParam.size() == 0) {
    233233                listParam.setActivParam(null);
    234                 JOptionPane.showMessageDialog(Main.parent, tr("No set of parameter is active!"), tr("Error"), JOptionPane.ERROR_MESSAGE);
     234                JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("No set of parameter is active!"), tr("Error"), JOptionPane.ERROR_MESSAGE);
    235235                return false;
    236236            }
     
    246246            if (dialog.getShow()) {
    247247                JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
    248                 JDialog dlg = pane.createDialog(Main.parent, tr("Tracer2") + " - " + tr("Select parameter"));
     248                JDialog dlg = pane.createDialog(MainApplication.getMainFrame(), tr("Tracer2") + " - " + tr("Select parameter"));
    249249                dlg.setVisible(true);
    250250                Object obj = pane.getValue();
     
    320320                    strCommand = tr("Tracer2: modify way to {0} points", coordList.size());
    321321                }
    322                 Main.main.undoRedo.add(new SequenceCommand(strCommand, commands));
     322                UndoRedoHandler.getInstance().add(new SequenceCommand(strCommand, commands));
    323323
    324324                if (m_bShift) {
  • applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParam.java

    r32788 r34564  
    1313import javax.swing.SwingUtilities;
    1414
    15 import org.openstreetmap.josm.Main;
     15import org.openstreetmap.josm.gui.MainApplication;
    1616import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
    1717import org.openstreetmap.josm.tools.GBC;
     
    204204            @Override
    205205            public void run() {
    206                 JOptionPane.showMessageDialog(Main.parent, p, tr("Tracer2 error"), JOptionPane.ERROR_MESSAGE);
     206                JOptionPane.showMessageDialog(MainApplication.getMainFrame(), p, tr("Tracer2 error"), JOptionPane.ERROR_MESSAGE);
    207207            }
    208208        });
  • applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamDialog.java

    r32788 r34564  
    1818import javax.swing.JTextField;
    1919
    20 import org.openstreetmap.josm.Main;
    2120import org.openstreetmap.josm.gui.ExtendedDialog;
     21import org.openstreetmap.josm.gui.MainApplication;
    2222import org.openstreetmap.josm.tools.GBC;
    2323
     
    111111
    112112    public ServerParamDialog(ServerParam param) {
    113         super(Main.parent, tr("Tracer2") + " - " + tr("Parameter for server request"),
     113        super(MainApplication.getMainFrame(), tr("Tracer2") + " - " + tr("Parameter for server request"),
    114114                new String[] {tr("OK"), tr("Cancel")},
    115115                true);
  • applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamPanel.java

    r32788 r34564  
    1616import javax.swing.JPanel;
    1717
    18 import org.openstreetmap.josm.Main;
     18import org.openstreetmap.josm.gui.MainApplication;
    1919
    2020public class ServerParamPanel extends JPanel {
     
    7474                @Override
    7575                public void actionPerformed(ActionEvent arg0) {
    76                     if (JOptionPane.showConfirmDialog(Main.parent,
     76                    if (JOptionPane.showConfirmDialog(MainApplication.getMainFrame(),
    7777                            tr("Delete parameter \"{0}\"?", param.getName()),
    7878                            tr("Are you sure?"),
     
    123123                if (dialog.getShow()) {
    124124                    JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
    125                     JDialog dlg = pane.createDialog(Main.parent, tr("Tracer2") + " - " + tr("Select predefined parameter"));
     125                    JDialog dlg = pane.createDialog(MainApplication.getMainFrame(), tr("Tracer2") + " - " + tr("Select predefined parameter"));
    126126                    dlg.setVisible(true);
    127127                    Object obj = pane.getValue();
  • applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/Request.java

    r34344 r34564  
    99import javax.swing.JOptionPane;
    1010
    11 import org.openstreetmap.josm.Main;
     11import org.openstreetmap.josm.gui.MainApplication;
    1212import org.openstreetmap.josm.tools.HttpClient;
    1313
     
    2828            return HttpClient.create(new URL(URL + strUrl)).connect().fetchContent();
    2929        } catch (IOException e) {
    30             JOptionPane.showMessageDialog(Main.parent,
     30            JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    3131                    tr("Tracer2Server isn''t running. Please start the Server.\nIf you don''t have the server, please download it from\n{0}.",
    3232                            "http://sourceforge.net/projects/tracer2server/"), tr("Error"), JOptionPane.ERROR_MESSAGE);
    3333            return "";
    3434        } catch (Exception e) {
    35             JOptionPane.showMessageDialog(Main.parent, tr("Tracer2Server hasn''t found anything.") + "\n",
     35            JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Tracer2Server hasn''t found anything.") + "\n",
    3636                    tr("Error"), JOptionPane.ERROR_MESSAGE);
    3737            return "";
     
    4848        if (strResponse.contains(strIdentifier)) {
    4949            String strError = strResponse.replaceFirst(strIdentifier, "").trim();
    50             JOptionPane.showMessageDialog(Main.parent, tr("Tracer2Server has detected an error.") + "\n" + strError,
     50            JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Tracer2Server has detected an error.") + "\n" + strError,
    5151                    tr("Error"), JOptionPane.ERROR_MESSAGE);
    5252            return true;
Note: See TracChangeset for help on using the changeset viewer.