Changeset 32458 in osm for applications/editors/josm/plugins
- Timestamp:
- 2016-06-30T00:23:36+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/turnlanes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/turnlanes/build.xml
r31926 r32458 5 5 <property name="commit.message" value="fix toolbar warnings - toolbar still does not work"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value=" 7001"/>7 <property name="plugin.main.version" value="10279"/> 8 8 9 9 <!-- -
applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/TurnLanesDialog.java
r30737 r32458 17 17 import javax.swing.JToggleButton; 18 18 19 import org.openstreetmap.josm.Main; 19 20 import org.openstreetmap.josm.actions.JosmAction; 20 21 import org.openstreetmap.josm.data.SelectionChangedListener; … … 32 33 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent; 33 34 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; 34 import org.openstreetmap.josm.gui.MapView;35 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener;36 35 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 36 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 37 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 37 38 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 38 39 import org.openstreetmap.josm.plugins.turnlanes.model.ModelContainer; 39 40 40 public class TurnLanesDialog extends ToggleDialog implements EditLayerChangeListener, SelectionChangedListener {41 public class TurnLanesDialog extends ToggleDialog implements ActiveLayerChangeListener, SelectionChangedListener { 41 42 private class EditAction extends JosmAction { 42 43 private static final long serialVersionUID = 4114119073563457706L; … … 45 46 super(tr("Edit"), "dialogs/edit", tr("Edit turn relations and lane lengths for selected node."), null, 46 47 false); 47 //putValue("toolbar", "turnlanes/edit"); Main.toolbar.register(this);48 // did not work in 501849 50 48 } 51 49 … … 66 64 super(tr("Validate"), "dialogs/validator", tr("Validate turn- and lane-length-relations for consistency."), 67 65 null, false); 68 // putValue("toolbar", "turnlanes/validate"); Main.toolbar.register(this);69 // did not work in 501870 66 } 71 67 … … 150 146 super(tr("Turn Lanes"), "turnlanes.png", tr("Edit turn lanes"), null, 200); 151 147 152 Ma pView.addEditLayerChangeListener(this);148 Main.getLayerManager().addActiveLayerChangeListener(this); 153 149 DataSet.addSelectionListener(this); 154 150 … … 192 188 } 193 189 194 @Override 195 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 190 @Override 191 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 192 OsmDataLayer oldLayer = e.getPreviousEditLayer(); 196 193 if (oldLayer != null) { 197 194 oldLayer.data.removeDataSetListener(dataSetListener); 198 195 } 199 196 OsmDataLayer newLayer = Main.getLayerManager().getEditLayer(); 200 197 if (newLayer != null) { 201 198 newLayer.data.addDataSetListener(dataSetListener); 202 199 } 203 204 205 206 200 } 201 202 @Override 203 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 207 204 if (selected.equals(new HashSet<>(newSelection))) { 208 205 return; … … 210 207 selected.clear(); 211 208 selected.addAll(newSelection); 212 209 213 210 refresh(); 214 215 216 217 218 219 Ma pView.removeEditLayerChangeListener(this);211 } 212 213 @Override 214 public void destroy() { 215 super.destroy(); 216 Main.getLayerManager().removeActiveLayerChangeListener(this); 220 217 DataSet.removeSelectionListener(this); 221 218 editAction.destroy(); 222 219 validateAction.destroy(); 223 220 } 224 221 } -
applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/ValidationPanel.java
r30737 r32458 37 37 @Override 38 38 public void actionPerformed(ActionEvent e) { 39 setIssues(new Validator().validate(Main. main.getCurrentDataSet()));39 setIssues(new Validator().validate(Main.getLayerManager().getEditDataSet())); 40 40 } 41 41 }; … … 62 62 public void actionPerformed(ActionEvent e) { 63 63 if (selected.getRelation() == null) { 64 Main. main.getCurrentDataSet().setSelected(selected.getPrimitives());64 Main.getLayerManager().getEditDataSet().setSelected(selected.getPrimitives()); 65 65 } else { 66 Main. main.getCurrentDataSet().setSelected(selected.getRelation());66 Main.getLayerManager().getEditDataSet().setSelected(selected.getRelation()); 67 67 } 68 68 }
Note:
See TracChangeset
for help on using the changeset viewer.