Changeset 34562 in osm for applications
- Timestamp:
- 2018-08-18T20:27:59+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/terracer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/terracer/build.xml
r33608 r34562 2 2 <project name="terracer" default="dist" basedir="."> 3 3 <property name="commit.message" value="applied #j5760 (patch by robome) - Order of housenumbers not correct"/> 4 <property name="plugin.main.version" value="1 2859"/>4 <property name="plugin.main.version" value="14153"/> 5 5 <property name="plugin.author" value="Matt Amos"/> 6 6 <property name="plugin.class" value="terracer.TerracerPlugin"/> -
applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputDialog.java
r33839 r34562 13 13 import java.util.ArrayList; 14 14 import java.util.Iterator; 15 import java.util.List;16 15 import java.util.TreeSet; 17 16 … … 23 22 import javax.swing.JTextField; 24 23 25 import org.openstreetmap.josm.Main;26 24 import org.openstreetmap.josm.data.osm.Node; 25 import org.openstreetmap.josm.data.osm.OsmDataManager; 27 26 import org.openstreetmap.josm.data.osm.OsmPrimitive; 28 27 import org.openstreetmap.josm.data.osm.Way; 29 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;30 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionSet;31 28 import org.openstreetmap.josm.gui.ExtendedDialog; 32 29 import org.openstreetmap.josm.gui.MainApplication; … … 34 31 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 35 32 import org.openstreetmap.josm.gui.util.WindowGeometry; 33 import org.openstreetmap.josm.spi.preferences.Config; 36 34 import org.openstreetmap.josm.tools.GBC; 37 35 … … 96 94 public HouseNumberInputDialog(HouseNumberInputHandler handler, Way street, String streetName, 97 95 String buildingType, boolean relationExists, ArrayList<Node> housenumbers) { 98 super(Main .parent,96 super(MainApplication.getMainFrame(), 99 97 tr("Terrace a house"), 100 98 new String[] {tr("OK"), tr("Cancel")}, … … 117 115 getRootPane().setDefaultButton(defaultButton); 118 116 pack(); 119 setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(Main .parent, getPreferredSize()));117 setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(MainApplication.getMainFrame(), getPreferredSize())); 120 118 lo.requestFocusInWindow(); 121 119 } … … 179 177 final String txt = relationExists ? tr("add to existing associatedStreet relation") : tr("create an associatedStreet relation"); 180 178 181 handleRelationCheckBox = new JCheckBox(txt, relationExists ? Main.pref.getBoolean(HANDLE_RELATION, true) : false);182 keepOutlineCheckBox = new JCheckBox(tr("keep outline way"), Main.pref.getBoolean(KEEP_OUTLINE, false));179 handleRelationCheckBox = new JCheckBox(txt, relationExists ? Config.getPref().getBoolean(HANDLE_RELATION, true) : false); 180 keepOutlineCheckBox = new JCheckBox(tr("keep outline way"), Config.getPref().getBoolean(KEEP_OUTLINE, false)); 183 181 184 182 inputPanel = new JPanel(); … … 314 312 if (buildingComboBox == null) { 315 313 buildingComboBox = new AutoCompletingComboBox(); 316 buildingComboBox.setPossibleAcItems(AutoCompletionManager.of( Main.main.getEditDataSet()).getTagValues("building"));314 buildingComboBox.setPossibleAcItems(AutoCompletionManager.of(OsmDataManager.getInstance().getEditDataSet()).getTagValues("building")); 317 315 buildingComboBox.setEditable(true); 318 316 if (buildingType != null && !buildingType.isEmpty()) { … … 333 331 if (segments == null) { 334 332 segments = new JTextField(); 335 segments.setText( Main.pref.get(DEFAULT_SEGMENTS, "2"));333 segments.setText(Config.getPref().get(DEFAULT_SEGMENTS, "2")); 336 334 } 337 335 return segments; … … 348 346 interpolation.add(tr("All")); 349 347 interpolation.add(tr("Even/Odd")); 350 if ( Main.pref.getInt(INTERPOLATION, 2) == 1) {348 if (Config.getPref().getInt(INTERPOLATION, 2) == 1) { 351 349 interpolation.select(tr("All")); 352 350 } else { -
applications/editors/josm/plugins/terracer/src/terracer/HouseNumberInputHandler.java
r33839 r34562 19 19 import javax.swing.JTextField; 20 20 21 import org.openstreetmap.josm.Main;22 21 import org.openstreetmap.josm.actions.JosmAction; 23 22 import org.openstreetmap.josm.data.osm.Node; … … 26 25 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem; 27 26 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox; 27 import org.openstreetmap.josm.spi.preferences.Config; 28 28 import org.openstreetmap.josm.tools.Logging; 29 29 import org.openstreetmap.josm.tools.UserCancelException; … … 445 445 */ 446 446 public void saveValues() { 447 Main.pref.putBoolean(HouseNumberInputDialog.HANDLE_RELATION, doHandleRelation());448 Main.pref.putBoolean(HouseNumberInputDialog.KEEP_OUTLINE, doKeepOutline());449 Main.pref.put(HouseNumberInputDialog.INTERPOLATION, stepSize().toString());447 Config.getPref().putBoolean(HouseNumberInputDialog.HANDLE_RELATION, doHandleRelation()); 448 Config.getPref().putBoolean(HouseNumberInputDialog.KEEP_OUTLINE, doKeepOutline()); 449 Config.getPref().put(HouseNumberInputDialog.INTERPOLATION, stepSize().toString()); 450 450 } 451 451 } -
applications/editors/josm/plugins/terracer/src/terracer/ReverseTerraceAction.java
r33579 r34562 13 13 import javax.swing.JOptionPane; 14 14 15 import org.openstreetmap.josm.Main;16 15 import org.openstreetmap.josm.actions.JosmAction; 17 16 import org.openstreetmap.josm.command.ChangePropertyCommand; 18 17 import org.openstreetmap.josm.command.Command; 19 18 import org.openstreetmap.josm.command.SequenceCommand; 19 import org.openstreetmap.josm.data.UndoRedoHandler; 20 20 import org.openstreetmap.josm.data.osm.Node; 21 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 81 81 82 82 if (front.isEmpty()) { 83 JOptionPane.showMessageDialog(Main .parent,83 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 84 84 tr("Cannot reverse!")); 85 85 return; … … 124 124 } 125 125 126 MainApplication.undoRedo.add(new SequenceCommand(tr("Reverse Terrace"), commands));126 UndoRedoHandler.getInstance().add(new SequenceCommand(tr("Reverse Terrace"), commands)); 127 127 MainApplication.getLayerManager().getEditDataSet().setSelected(orderedWays); 128 128 } -
applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java
r33608 r34562 24 24 import javax.swing.JOptionPane; 25 25 26 import org.openstreetmap.josm.Main;27 26 import org.openstreetmap.josm.actions.JosmAction; 28 27 import org.openstreetmap.josm.command.AddCommand; … … 32 31 import org.openstreetmap.josm.command.DeleteCommand; 33 32 import org.openstreetmap.josm.command.SequenceCommand; 33 import org.openstreetmap.josm.data.UndoRedoHandler; 34 34 import org.openstreetmap.josm.data.osm.DataSet; 35 35 import org.openstreetmap.josm.data.osm.Node; … … 179 179 } catch (InvalidUserInputException ex) { 180 180 Logging.warn("Terracer: "+ex.getMessage()); 181 new ExtendedDialog(Main .parent, tr("Invalid selection"), new String[] {"OK"})181 new ExtendedDialog(MainApplication.getMainFrame(), tr("Invalid selection"), new String[] {"OK"}) 182 182 .setButtonIcons(new String[] {"ok"}).setIcon(JOptionPane.INFORMATION_MESSAGE) 183 183 .setContent(tr("Select a single, closed way of at least four nodes. " + … … 425 425 } 426 426 427 MainApplication.undoRedo.add(createTerracingCommand(outline));427 UndoRedoHandler.getInstance().add(createTerracingCommand(outline)); 428 428 if (nb <= 1 && street != null) { 429 429 // Select the way (for quick selection of a new house (with the same way))
Note:
See TracChangeset
for help on using the changeset viewer.