Changeset 34493 in osm for applications/editors/josm


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

update to JOSM 14153

Location:
applications/editors/josm/plugins/buildings_tools
Files:
5 edited

Legend:

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

    r34212 r34493  
    44    <property name="commit.message" value="BuildingTools: Alt key to disable tags"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="13807"/>
     6    <property name="plugin.main.version" value="14153"/>
    77   
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/buildings_tools/src/buildings_tools/Building.java

    r34026 r34493  
    1818import javax.swing.JOptionPane;
    1919
    20 import org.openstreetmap.josm.Main;
    2120import org.openstreetmap.josm.actions.CreateCircleAction;
    2221import org.openstreetmap.josm.command.AddCommand;
     
    2524import org.openstreetmap.josm.command.DeleteCommand;
    2625import org.openstreetmap.josm.command.SequenceCommand;
     26import org.openstreetmap.josm.data.UndoRedoHandler;
    2727import org.openstreetmap.josm.data.coor.EastNorth;
    2828import org.openstreetmap.josm.data.coor.LatLon;
     
    306306            }
    307307            if (nodes[i].getCoor().isOutSideWorld()) {
    308                 JOptionPane.showMessageDialog(Main.parent,
     308                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    309309                        tr("Cannot place building outside of the world."));
    310310                return null;
     
    326326        if (addNodesCmd.size() > 0) {
    327327            Command addNodes = new SequenceCommand(tr("Add nodes for building"), addNodesCmd);
    328             Main.main.undoRedo.add(addNodes);
     328            UndoRedoHandler.getInstance().add(addNodes);
    329329        }
    330330
     
    370370            }
    371371            if (nodes[i].getCoor().isOutSideWorld()) {
    372                 JOptionPane.showMessageDialog(Main.parent,
     372                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
    373373                        tr("Cannot place building outside of the world."));
    374374                return null;
     
    398398
    399399        Command c = new SequenceCommand(tr("Create building"), cmds);
    400         Main.main.undoRedo.add(c);
     400        UndoRedoHandler.getInstance().add(c);
    401401        return w;
    402402    }
     
    424424                addressCmds.add(new DeleteCommand(addrNode));
    425425                Command c = new SequenceCommand(tr("Add address for building"), addressCmds);
    426                 Main.main.undoRedo.add(c);
     426                UndoRedoHandler.getInstance().add(c);
    427427            }
    428428        }
  • applications/editors/josm/plugins/buildings_tools/src/buildings_tools/MergeAddrPointsAction.java

    r32728 r34493  
    1717import javax.swing.JOptionPane;
    1818
    19 import org.openstreetmap.josm.Main;
    2019import org.openstreetmap.josm.actions.JosmAction;
    2120import org.openstreetmap.josm.command.ChangeCommand;
     
    2423import org.openstreetmap.josm.command.DeleteCommand;
    2524import org.openstreetmap.josm.command.SequenceCommand;
     25import org.openstreetmap.josm.data.UndoRedoHandler;
    2626import org.openstreetmap.josm.data.osm.Node;
    2727import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    145145                    .setIcon(JOptionPane.INFORMATION_MESSAGE).show();
    146146        if (!cmds.isEmpty())
    147             Main.main.undoRedo.add(new SequenceCommand("Merge addresses", cmds));
     147            UndoRedoHandler.getInstance().add(new SequenceCommand("Merge addresses", cmds));
    148148    }
    149149
  • applications/editors/josm/plugins/buildings_tools/src/buildings_tools/MyDialog.java

    r30045 r34493  
    1111import javax.swing.JPanel;
    1212
    13 import org.openstreetmap.josm.Main;
    1413import org.openstreetmap.josm.gui.ExtendedDialog;
     14import org.openstreetmap.josm.gui.MainApplication;
    1515import org.openstreetmap.josm.tools.GBC;
    1616
     
    2929
    3030    public MyDialog(String title) {
    31         super(Main.parent, title, BUTTON_TEXTS, true);
     31        super(MainApplication.getMainFrame(), title, BUTTON_TEXTS, true);
    3232        contentInsets = new Insets(15, 15, 5, 15);
    3333        setButtonIcons(BUTTON_ICONS);
  • applications/editors/josm/plugins/buildings_tools/src/buildings_tools/ToolSettings.java

    r34026 r34493  
    1111import java.util.NoSuchElementException;
    1212
    13 import org.openstreetmap.josm.Main;
    1413import org.openstreetmap.josm.data.preferences.BooleanProperty;
     14import org.openstreetmap.josm.spi.preferences.Config;
    1515import org.openstreetmap.josm.tools.Logging;
    1616
     
    7373            values.add(entry.getValue());
    7474        }
    75         Main.pref.putList("buildings_tools.tags", values);
     75        Config.getPref().putList("buildings_tools.tags", values);
    7676    }
    7777
    7878    private static void loadTags() {
    7979        TAGS.clear();
    80         Collection<String> values = Main.pref.getList("buildings_tools.tags",
     80        Collection<String> values = Config.getPref().getList("buildings_tools.tags",
    8181                Arrays.asList("building", "yes"));
    8282        try {
     
    9090
    9191    public static void saveShape(Shape shape) {
    92         Main.pref.put("buildings_tool.shape", shape.name());
     92        Config.getPref().put("buildings_tool.shape", shape.name());
    9393    }
    9494
    9595    private static Shape loadShape() {
    96         String shape = Main.pref.get("buildings_tool.shape");
     96        String shape = Config.getPref().get("buildings_tool.shape");
    9797        if (ToolSettings.Shape.CIRCLE.name().equals(shape)) {
    9898            ToolSettings.shape = Shape.CIRCLE;
     
    105105
    106106    public static void setBBMode(boolean bbmode) {
    107         Main.pref.putBoolean("buildings_tools.bbmode", bbmode);
     107        Config.getPref().putBoolean("buildings_tools.bbmode", bbmode);
    108108    }
    109109
    110110    public static boolean isBBMode() {
    111         return Main.pref.getBoolean("buildings_tools.bbmode", false);
     111        return Config.getPref().getBoolean("buildings_tools.bbmode", false);
    112112    }
    113113
    114114    public static void setSoftCursor(boolean softCursor) {
    115         Main.pref.putBoolean("buildings_tools.softcursor", softCursor);
     115        Config.getPref().putBoolean("buildings_tools.softcursor", softCursor);
    116116    }
    117117
    118118    public static boolean isSoftCursor() {
    119         return Main.pref.getBoolean("buildings_tools.softcursor", false);
     119        return Config.getPref().getBoolean("buildings_tools.softcursor", false);
    120120    }
    121121
Note: See TracChangeset for help on using the changeset viewer.