Changeset 34493 in osm for applications/editors/josm
- Timestamp:
- 2018-08-18T02:58:59+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/buildings_tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/buildings_tools/build.xml
r34212 r34493 4 4 <property name="commit.message" value="BuildingTools: Alt key to disable tags"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 3807"/>6 <property name="plugin.main.version" value="14153"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/buildings_tools/src/buildings_tools/Building.java
r34026 r34493 18 18 import javax.swing.JOptionPane; 19 19 20 import org.openstreetmap.josm.Main;21 20 import org.openstreetmap.josm.actions.CreateCircleAction; 22 21 import org.openstreetmap.josm.command.AddCommand; … … 25 24 import org.openstreetmap.josm.command.DeleteCommand; 26 25 import org.openstreetmap.josm.command.SequenceCommand; 26 import org.openstreetmap.josm.data.UndoRedoHandler; 27 27 import org.openstreetmap.josm.data.coor.EastNorth; 28 28 import org.openstreetmap.josm.data.coor.LatLon; … … 306 306 } 307 307 if (nodes[i].getCoor().isOutSideWorld()) { 308 JOptionPane.showMessageDialog(Main .parent,308 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 309 309 tr("Cannot place building outside of the world.")); 310 310 return null; … … 326 326 if (addNodesCmd.size() > 0) { 327 327 Command addNodes = new SequenceCommand(tr("Add nodes for building"), addNodesCmd); 328 Main.main.undoRedo.add(addNodes);328 UndoRedoHandler.getInstance().add(addNodes); 329 329 } 330 330 … … 370 370 } 371 371 if (nodes[i].getCoor().isOutSideWorld()) { 372 JOptionPane.showMessageDialog(Main .parent,372 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 373 373 tr("Cannot place building outside of the world.")); 374 374 return null; … … 398 398 399 399 Command c = new SequenceCommand(tr("Create building"), cmds); 400 Main.main.undoRedo.add(c);400 UndoRedoHandler.getInstance().add(c); 401 401 return w; 402 402 } … … 424 424 addressCmds.add(new DeleteCommand(addrNode)); 425 425 Command c = new SequenceCommand(tr("Add address for building"), addressCmds); 426 Main.main.undoRedo.add(c);426 UndoRedoHandler.getInstance().add(c); 427 427 } 428 428 } -
applications/editors/josm/plugins/buildings_tools/src/buildings_tools/MergeAddrPointsAction.java
r32728 r34493 17 17 import javax.swing.JOptionPane; 18 18 19 import org.openstreetmap.josm.Main;20 19 import org.openstreetmap.josm.actions.JosmAction; 21 20 import org.openstreetmap.josm.command.ChangeCommand; … … 24 23 import org.openstreetmap.josm.command.DeleteCommand; 25 24 import org.openstreetmap.josm.command.SequenceCommand; 25 import org.openstreetmap.josm.data.UndoRedoHandler; 26 26 import org.openstreetmap.josm.data.osm.Node; 27 27 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 145 145 .setIcon(JOptionPane.INFORMATION_MESSAGE).show(); 146 146 if (!cmds.isEmpty()) 147 Main.main.undoRedo.add(new SequenceCommand("Merge addresses", cmds));147 UndoRedoHandler.getInstance().add(new SequenceCommand("Merge addresses", cmds)); 148 148 } 149 149 -
applications/editors/josm/plugins/buildings_tools/src/buildings_tools/MyDialog.java
r30045 r34493 11 11 import javax.swing.JPanel; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.gui.ExtendedDialog; 14 import org.openstreetmap.josm.gui.MainApplication; 15 15 import org.openstreetmap.josm.tools.GBC; 16 16 … … 29 29 30 30 public MyDialog(String title) { 31 super(Main .parent, title, BUTTON_TEXTS, true);31 super(MainApplication.getMainFrame(), title, BUTTON_TEXTS, true); 32 32 contentInsets = new Insets(15, 15, 5, 15); 33 33 setButtonIcons(BUTTON_ICONS); -
applications/editors/josm/plugins/buildings_tools/src/buildings_tools/ToolSettings.java
r34026 r34493 11 11 import java.util.NoSuchElementException; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.data.preferences.BooleanProperty; 14 import org.openstreetmap.josm.spi.preferences.Config; 15 15 import org.openstreetmap.josm.tools.Logging; 16 16 … … 73 73 values.add(entry.getValue()); 74 74 } 75 Main.pref.putList("buildings_tools.tags", values);75 Config.getPref().putList("buildings_tools.tags", values); 76 76 } 77 77 78 78 private static void loadTags() { 79 79 TAGS.clear(); 80 Collection<String> values = Main.pref.getList("buildings_tools.tags",80 Collection<String> values = Config.getPref().getList("buildings_tools.tags", 81 81 Arrays.asList("building", "yes")); 82 82 try { … … 90 90 91 91 public static void saveShape(Shape shape) { 92 Main.pref.put("buildings_tool.shape", shape.name());92 Config.getPref().put("buildings_tool.shape", shape.name()); 93 93 } 94 94 95 95 private static Shape loadShape() { 96 String shape = Main.pref.get("buildings_tool.shape");96 String shape = Config.getPref().get("buildings_tool.shape"); 97 97 if (ToolSettings.Shape.CIRCLE.name().equals(shape)) { 98 98 ToolSettings.shape = Shape.CIRCLE; … … 105 105 106 106 public static void setBBMode(boolean bbmode) { 107 Main.pref.putBoolean("buildings_tools.bbmode", bbmode);107 Config.getPref().putBoolean("buildings_tools.bbmode", bbmode); 108 108 } 109 109 110 110 public static boolean isBBMode() { 111 return Main.pref.getBoolean("buildings_tools.bbmode", false);111 return Config.getPref().getBoolean("buildings_tools.bbmode", false); 112 112 } 113 113 114 114 public static void setSoftCursor(boolean softCursor) { 115 Main.pref.putBoolean("buildings_tools.softcursor", softCursor);115 Config.getPref().putBoolean("buildings_tools.softcursor", softCursor); 116 116 } 117 117 118 118 public static boolean isSoftCursor() { 119 return Main.pref.getBoolean("buildings_tools.softcursor", false);119 return Config.getPref().getBoolean("buildings_tools.softcursor", false); 120 120 } 121 121
Note:
See TracChangeset
for help on using the changeset viewer.