Changeset 34567 in osm
- Timestamp:
- 2018-08-18T20:50:44+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/turnrestrictions
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/turnrestrictions/.classpath
r32925 r34567 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="src" path="test/unit"/> 4 <classpathentry kind="src" output="buildtest" path="test/unit"> 5 <attributes> 6 <attribute name="test" value="true"/> 7 </attributes> 8 </classpathentry> 5 9 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> 6 10 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> -
applications/editors/josm/plugins/turnrestrictions/build.xml
r34129 r34567 4 4 <property name="commit.message" value="Adapt to JOSM core change (DefaultNameFormatter)"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 3564"/>6 <property name="plugin.main.version" value="14153"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanel.java
r32519 r34567 15 15 import javax.swing.JScrollPane; 16 16 17 import org.openstreetmap.josm.Main;18 import org.openstreetmap.josm.data.Preferences;19 17 import org.openstreetmap.josm.gui.help.HelpUtil; 20 18 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel; 21 19 import org.openstreetmap.josm.plugins.turnrestrictions.editor.NavigationControler.BasicEditorFokusTargets; 22 20 import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceKeys; 21 import org.openstreetmap.josm.spi.preferences.Config; 22 import org.openstreetmap.josm.spi.preferences.IPreferences; 23 23 import org.openstreetmap.josm.tools.CheckParameterUtil; 24 24 … … 100 100 }; 101 101 add(spVias, gc); 102 if (! Main.pref.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false)) {102 if (!Config.getPref().getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false)) { 103 103 lblVias.setVisible(false); 104 104 spVias.setVisible(false); … … 171 171 * @param prefs the JOSM preferences 172 172 */ 173 public void initIconSetFromPreferences( Preferences prefs) {173 public void initIconSetFromPreferences(IPreferences prefs) { 174 174 cbTurnRestrictions.initIconSetFromPreferences(prefs); 175 175 } … … 181 181 * @param prefs the JOSM preferences 182 182 */ 183 public void initViasVisibilityFromPreferences( Preferences prefs) {183 public void initViasVisibilityFromPreferences(IPreferences prefs) { 184 184 boolean value = prefs.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false); 185 185 if (value != lblVias.isVisible()) { -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java
r33537 r34567 12 12 import javax.swing.ListSelectionModel; 13 13 14 import org.openstreetmap.josm.data. SelectionChangedListener;14 import org.openstreetmap.josm.data.osm.DataSelectionListener; 15 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 16 import org.openstreetmap.josm.data.osm.PrimitiveId; … … 37 37 */ 38 38 public class JosmSelectionListModel extends AbstractListModel<OsmPrimitive> 39 implements ActiveLayerChangeListener, SelectionChangedListener, DataSetListener, PrimitiveIdListProvider {39 implements ActiveLayerChangeListener, DataSelectionListener, DataSetListener, PrimitiveIdListProvider { 40 40 41 41 private final List<OsmPrimitive> selection = new ArrayList<>(); … … 172 172 /* ------------------------------------------------------------------------ */ 173 173 @Override 174 public void selectionChanged( Collection<? extends OsmPrimitive> newSelection) {174 public void selectionChanged(SelectionChangeEvent event) { 175 175 // only update the JOSM selection if it is changed in the same data layer 176 176 // this turn restriction editor is working on … … 178 178 if (layer == null) return; 179 179 if (layer != this.layer) return; 180 setJOSMSelection( newSelection);180 setJOSMSelection(event.getSelection()); 181 181 } 182 182 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java
r34129 r34567 88 88 MainApplication.getLayerManager().addActiveLayerChangeListener(model); 89 89 DatasetEventManager.getInstance().addDatasetListener(model, FireMode.IN_EDT); 90 SelectionEventManager.getInstance().addSelectionListener (model, FireMode.IN_EDT_CONSOLIDATED);90 SelectionEventManager.getInstance().addSelectionListenerForEdt(model); 91 91 } 92 92 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTable.java
r32519 r34567 36 36 import org.openstreetmap.josm.plugins.turnrestrictions.dnd.PrimitiveIdTransferable; 37 37 import org.openstreetmap.josm.tools.ImageProvider; 38 import org.openstreetmap.josm.tools.Logging; 38 39 import org.openstreetmap.josm.tools.Shortcut; 39 40 … … 151 152 model.getRelationMemberEditorModel().insertMembers(ids); 152 153 } catch (IllegalArgumentException e) { 153 e.printStackTrace();154 Logging.error(e); 154 155 // FIXME: provide user feedback 155 156 } 156 } catch (IOException e) { 157 e.printStackTrace(); 158 } catch (UnsupportedFlavorException e) { 159 e.printStackTrace(); 157 } catch (IOException | UnsupportedFlavorException e) { 158 Logging.error(e); 160 159 } 161 160 } … … 271 270 } 272 271 return true; 273 } catch (IOException e) { 274 e.printStackTrace(); 275 } catch (UnsupportedFlavorException e) { 276 e.printStackTrace(); 272 } catch (IOException | UnsupportedFlavorException e) { 273 Logging.error(e); 277 274 } 278 275 return false; … … 348 345 model.getRelationMemberEditorModel().insertMembers(ids); 349 346 } catch (IllegalArgumentException e) { 350 e.printStackTrace();347 Logging.error(e); 351 348 // FIXME: provide user feedback 352 349 } 353 } catch (IOException e) { 354 e.printStackTrace(); 355 } catch (UnsupportedFlavorException e) { 356 e.printStackTrace(); 350 } catch (IOException | UnsupportedFlavorException e) { 351 Logging.error(e); 357 352 } finally { 358 353 setColumnSelectionAllowed(true); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBox.java
r32519 r34567 4 4 import javax.swing.JComboBox; 5 5 6 import org.openstreetmap.josm.data.Preferences;7 6 import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceKeys; 7 import org.openstreetmap.josm.spi.preferences.IPreferences; 8 8 /** 9 9 * A combo box for selecting a turn restriction type. … … 37 37 * @param prefs the JOSM preferences 38 38 */ 39 public void initIconSetFromPreferences( Preferences prefs) {39 public void initIconSetFromPreferences(IPreferences prefs) { 40 40 TurnRestrictionTypeRenderer renderer = (TurnRestrictionTypeRenderer) getRenderer(); 41 41 renderer.initIconSetFromPreferences(prefs); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java
r34128 r34567 35 35 import javax.swing.KeyStroke; 36 36 37 import org.openstreetmap.josm.Main;38 37 import org.openstreetmap.josm.actions.AutoScaleAction; 39 38 import org.openstreetmap.josm.command.AddCommand; 40 39 import org.openstreetmap.josm.command.ChangeCommand; 41 40 import org.openstreetmap.josm.command.conflict.ConflictAddCommand; 41 import org.openstreetmap.josm.data.UndoRedoHandler; 42 42 import org.openstreetmap.josm.data.conflict.Conflict; 43 43 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; … … 53 53 import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceKeys; 54 54 import org.openstreetmap.josm.plugins.turnrestrictions.qa.IssuesView; 55 import org.openstreetmap.josm.spi.preferences.Config; 55 56 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent; 56 57 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener; … … 335 336 pnlJosmSelection.wireListeners(); 336 337 editorModel.registerAsEventListener(); 337 Main.pref.addPreferenceChangeListener(this.preferenceChangeHandler = new PreferenceChangeHandler());338 pnlBasicEditor.initIconSetFromPreferences( Main.pref);338 Config.getPref().addPreferenceChangeListener(this.preferenceChangeHandler = new PreferenceChangeHandler()); 339 pnlBasicEditor.initIconSetFromPreferences(Config.getPref()); 339 340 } else if (!visible && isVisible()) { 340 341 pnlJosmSelection.unwireListeners(); 341 342 editorModel.unregisterAsEventListener(); 342 Main.pref.removePreferenceChangeListener(preferenceChangeHandler);343 Config.getPref().removePreferenceChangeListener(preferenceChangeHandler); 343 344 } 344 345 super.setVisible(visible); … … 546 547 } 547 548 548 MainApplication.undoRedo.add(new AddCommand(getLayer().getDataSet(), newTurnRestriction));549 UndoRedoHandler.getInstance().add(new AddCommand(getLayer().getDataSet(), newTurnRestriction)); 549 550 550 551 // make sure everybody is notified about the changes … … 568 569 editorModel.apply(toUpdate); 569 570 Conflict<Relation> conflict = new Conflict<>(getTurnRestriction(), toUpdate); 570 MainApplication.undoRedo.add(new ConflictAddCommand(getLayer().getDataSet(), conflict));571 UndoRedoHandler.getInstance().add(new ConflictAddCommand(getLayer().getDataSet(), conflict)); 571 572 } 572 573 … … 578 579 if (getTurnRestriction().getDataSet() == null) { 579 580 editorModel.apply(getTurnRestriction()); 580 MainApplication.undoRedo.add(new AddCommand(getLayer().getDataSet(), getTurnRestriction()));581 UndoRedoHandler.getInstance().add(new AddCommand(getLayer().getDataSet(), getTurnRestriction())); 581 582 } else { 582 583 Relation toUpdate = new Relation(getTurnRestriction()); 583 584 editorModel.apply(toUpdate); 584 MainApplication.undoRedo.add(new ChangeCommand(getTurnRestriction(), toUpdate));585 UndoRedoHandler.getInstance().add(new ChangeCommand(getTurnRestriction(), toUpdate)); 585 586 } 586 587 // this will refresh the snapshot and update the dialog title … … 606 607 607 608 int ret = HelpAwareOptionPane.showOptionDialog( 608 Main .parent,609 MainApplication.getMainFrame(), 609 610 tr("<html>This turn restriction has been changed outside of the editor.<br>" 610 611 + "You cannot apply your changes and continue editing.<br>" … … 623 624 protected void warnDoubleConflict() { 624 625 JOptionPane.showMessageDialog( 625 Main .parent,626 MainApplication.getMainFrame(), 626 627 tr("<html>Layer ''{0}'' already has a conflict for object<br>" 627 628 + "''{1}''.<br>" … … 886 887 class PreferenceChangeHandler implements PreferenceChangedListener { 887 888 public void refreshIconSet() { 888 pnlBasicEditor.initIconSetFromPreferences( Main.pref);889 pnlBasicEditor.initIconSetFromPreferences(Config.getPref()); 889 890 } 890 891 … … 894 895 refreshIconSet(); 895 896 } else if (evt.getKey().equals(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR)) { 896 pnlBasicEditor.initViasVisibilityFromPreferences( Main.pref);897 pnlBasicEditor.initViasVisibilityFromPreferences(Config.getPref()); 897 898 } 898 899 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRenderer.java
r32925 r34567 15 15 import javax.swing.UIManager; 16 16 17 import org.openstreetmap.josm.data.Preferences;18 17 import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceKeys; 18 import org.openstreetmap.josm.spi.preferences.IPreferences; 19 19 import org.openstreetmap.josm.tools.ImageProvider; 20 20 … … 61 61 * @param prefs the JOSM preferences 62 62 */ 63 public void initIconSetFromPreferences( Preferences prefs) {63 public void initIconSetFromPreferences(IPreferences prefs) { 64 64 iconSet = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a"); 65 65 iconSet = iconSet.trim().toLowerCase(); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaList.java
r34129 r34567 38 38 import org.openstreetmap.josm.plugins.turnrestrictions.dnd.PrimitiveIdTransferable; 39 39 import org.openstreetmap.josm.tools.ImageProvider; 40 import org.openstreetmap.josm.tools.Logging; 40 41 import org.openstreetmap.josm.tools.Shortcut; 41 42 … … 131 132 List<PrimitiveId> idsToAdd = (List<PrimitiveId>) t.getTransferData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR); 132 133 model.insertVias(idsToAdd); 133 } catch (IOException e) { 134 e.printStackTrace(); 135 } catch (UnsupportedFlavorException e) { 136 e.printStackTrace(); 134 } catch (IOException | UnsupportedFlavorException e) { 135 Logging.error(e); 137 136 } 138 137 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/AbstractTurnRestrictionsListView.java
r32519 r34567 6 6 import javax.swing.event.ListSelectionListener; 7 7 8 import org.openstreetmap.josm.data.Preferences;9 8 import org.openstreetmap.josm.data.osm.Relation; 9 import org.openstreetmap.josm.spi.preferences.IPreferences; 10 10 11 11 /** … … 36 36 } 37 37 38 public void initIconSetFromPreferences( Preferences prefs) {38 public void initIconSetFromPreferences(IPreferences prefs) { 39 39 TurnRestrictionCellRenderer renderer = (TurnRestrictionCellRenderer) lstTurnRestrictions.getCellRenderer(); 40 40 renderer.initIconSetFromPreferences(prefs); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java
r33537 r34567 23 23 import javax.swing.table.TableCellRenderer; 24 24 25 import org.openstreetmap.josm.data.Preferences;26 25 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 27 26 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 31 30 import org.openstreetmap.josm.gui.widgets.JMultilineLabel; 32 31 import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceKeys; 32 import org.openstreetmap.josm.spi.preferences.IPreferences; 33 33 import org.openstreetmap.josm.tools.ImageProvider; 34 34 … … 220 220 * @param prefs the JOSM preferences 221 221 */ 222 public void initIconSetFromPreferences( Preferences prefs) {222 public void initIconSetFromPreferences(IPreferences prefs) { 223 223 224 224 iconSet = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a"); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionListModel.java
r33537 r34567 8 8 import javax.swing.DefaultListSelectionModel; 9 9 10 import org.openstreetmap.josm.data. SelectionChangedListener;10 import org.openstreetmap.josm.data.osm.DataSelectionListener; 11 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 12 import org.openstreetmap.josm.data.osm.Relation; … … 21 21 */ 22 22 public class TurnRestrictionsInSelectionListModel extends TurnRestrictionsListModel 23 implements ActiveLayerChangeListener, SelectionChangedListener {23 implements ActiveLayerChangeListener, DataSelectionListener { 24 24 25 25 public TurnRestrictionsInSelectionListModel( … … 63 63 /* --------------------------------------------------------------------------- */ 64 64 @Override 65 public void selectionChanged( Collection<? extends OsmPrimitive> newSelection) {66 initFromSelection( newSelection);65 public void selectionChanged(SelectionChangeEvent event) { 66 initFromSelection(event.getSelection()); 67 67 } 68 68 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java
r33537 r34567 10 10 import javax.swing.ListSelectionModel; 11 11 12 import org.openstreetmap.josm.data. SelectionChangedListener;12 import org.openstreetmap.josm.data.osm.DataSelectionListener; 13 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 14 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;15 14 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 16 15 import org.openstreetmap.josm.gui.MainApplication; … … 38 37 protected void registerAsListener() { 39 38 MainApplication.getLayerManager().addActiveLayerChangeListener((ActiveLayerChangeListener) model); 40 SelectionEventManager.getInstance().addSelectionListener ((SelectionChangedListener) model, FireMode.IN_EDT_CONSOLIDATED);39 SelectionEventManager.getInstance().addSelectionListenerForEdt((DataSelectionListener) model); 41 40 TurnRestrictionsInSelectionListModel m = (TurnRestrictionsInSelectionListModel) model; 42 41 if (MainApplication.getLayerManager().getEditLayer() != null) { … … 49 48 protected void unregisterAsListener() { 50 49 MainApplication.getLayerManager().removeActiveLayerChangeListener((ActiveLayerChangeListener) model); 51 SelectionEventManager.getInstance().removeSelectionListener(( SelectionChangedListener) model);50 SelectionEventManager.getInstance().removeSelectionListener((DataSelectionListener) model); 52 51 } 53 52 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java
r33780 r34567 23 23 import javax.swing.event.ListSelectionListener; 24 24 25 import org.openstreetmap.josm.Main;26 25 import org.openstreetmap.josm.actions.AutoScaleAction; 27 26 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 40 39 import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionEditorManager; 41 40 import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceKeys; 41 import org.openstreetmap.josm.spi.preferences.Config; 42 42 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent; 43 43 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener; … … 82 82 MainApplication.getLayerManager().addActiveLayerChangeListener(actNew); 83 83 actNew.updateEnabledState(); 84 Main.pref.addPreferenceChangeListener(preferenceChangeHandler);84 Config.getPref().addPreferenceChangeListener(preferenceChangeHandler); 85 85 preferenceChangeHandler.refreshIconSet(); 86 86 } … … 91 91 pnlTurnRestrictionsInSelection.unregisterAsListener(); 92 92 MainApplication.getLayerManager().removeActiveLayerChangeListener(actNew); 93 Main.pref.removePreferenceChangeListener(preferenceChangeHandler);93 Config.getPref().removePreferenceChangeListener(preferenceChangeHandler); 94 94 } 95 95 … … 445 445 class PreferenceChangeHandler implements PreferenceChangedListener { 446 446 public void refreshIconSet() { 447 pnlTurnRestrictionsInDataSet.initIconSetFromPreferences( Main.pref);448 pnlTurnRestrictionsInSelection.initIconSetFromPreferences( Main.pref);447 pnlTurnRestrictionsInDataSet.initIconSetFromPreferences(Config.getPref()); 448 pnlTurnRestrictionsInSelection.initIconSetFromPreferences(Config.getPref()); 449 449 repaint(); 450 450 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceEditor.java
r32925 r34567 19 19 import javax.swing.event.HyperlinkListener; 20 20 21 import org.openstreetmap.josm.Main;22 21 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 23 22 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 24 23 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 24 import org.openstreetmap.josm.spi.preferences.Config; 25 25 import org.openstreetmap.josm.tools.GBC; 26 26 import org.openstreetmap.josm.tools.ImageProvider; … … 83 83 84 84 pnlIconPreferences = new PreferencesPanel(); 85 pnlIconPreferences.initFromPreferences( Main.pref);85 pnlIconPreferences.initFromPreferences(Config.getPref()); 86 86 87 87 JScrollPane sp = new JScrollPane(pnlIconPreferences); … … 113 113 @Override 114 114 public boolean ok() { 115 pnlIconPreferences.saveToPreferences( Main.pref);115 pnlIconPreferences.saveToPreferences(Config.getPref()); 116 116 return false; 117 117 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferencesPanel.java
r33780 r34567 17 17 import javax.swing.JSeparator; 18 18 19 import org.openstreetmap.josm.data.Preferences;20 19 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 21 20 import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel; 22 21 import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionType; 22 import org.openstreetmap.josm.spi.preferences.IPreferences; 23 23 import org.openstreetmap.josm.tools.ImageProvider; 24 24 … … 171 171 * @param prefs the preferences 172 172 */ 173 public void initFromPreferences( Preferences prefs) {173 public void initFromPreferences(IPreferences prefs) { 174 174 String set = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a"); 175 175 if (!set.equals("set-a") && !set.equals("set-b")) { … … 194 194 * @param prefs the preferences 195 195 */ 196 public void saveToPreferences( Preferences prefs) {196 public void saveToPreferences(IPreferences prefs) { 197 197 prefs.put(PreferenceKeys.ROAD_SIGNS, rbSetA.isSelected() ? "set-a" : "set-b"); 198 198 prefs.putBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, cbShowViaListInBasicEditor.isSelected()); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java
r33780 r34567 11 11 12 12 import org.openstreetmap.josm.command.SplitWayCommand; 13 import org.openstreetmap.josm.data.UndoRedoHandler; 13 14 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 14 15 import org.openstreetmap.josm.data.osm.Node; 15 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 17 import org.openstreetmap.josm.data.osm.Way; 17 import org.openstreetmap.josm.gui.MainApplication;18 18 import org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder; 19 19 import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionLegRole; … … 138 138 ); 139 139 if (result != null) { 140 MainApplication.undoRedo.add(result);140 UndoRedoHandler.getInstance().add(result); 141 141 } 142 142 } … … 149 149 ); 150 150 if (result != null) { 151 MainApplication.undoRedo.add(result);151 UndoRedoHandler.getInstance().add(result); 152 152 } 153 153 if (result == null) return;
Note:
See TracChangeset
for help on using the changeset viewer.