Changeset 32456 in osm for applications/editors/josm/plugins/routes/src
- Timestamp:
- 2016-06-30T00:16:11+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RelationEditMode.java
r27852 r32456 62 62 @Override 63 63 public void mouseClicked(MouseEvent e) { 64 if ( Main.main.getCurrentDataSet() == null)64 if (getLayerManager().getEditDataSet() == null) 65 65 return; 66 66 67 67 Way way = Main.map.mapView.getNearestWay(e.getPoint(), OsmPrimitive.isUsablePredicate); 68 Collection<Relation> selectedRelations = Main.main.getCurrentDataSet().getSelectedRelations();68 Collection<Relation> selectedRelations = getLayerManager().getEditDataSet().getSelectedRelations(); 69 69 70 70 if (way != null) { -
applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteLayer.java
r30737 r32456 104 104 public void paint(Graphics2D g, MapView mv, Bounds bounds) { 105 105 106 DataSet dataset = Main. main.getCurrentDataSet();106 DataSet dataset = Main.getLayerManager().getEditDataSet(); 107 107 108 108 if (dataset == null) { -
applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java
r32329 r32456 15 15 16 16 import org.openstreetmap.josm.Main; 17 import org.openstreetmap.josm.gui.MapView;18 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;19 17 import org.openstreetmap.josm.gui.layer.Layer; 18 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; 19 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener; 20 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; 21 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; 20 22 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 21 23 import org.openstreetmap.josm.plugins.Plugin; … … 31 33 public RoutesPlugin(PluginInformation info) { 32 34 super(info); 33 Ma pView.addLayerChangeListener(this);35 Main.getLayerManager().addLayerChangeListener(this); 34 36 35 37 File routesFile = new File(getPluginDir() + File.separator + "routes.xml"); … … 40 42 routesFile.getParentFile().mkdir(); 41 43 try ( 42 OutputStream outputStream = new FileOutputStream(routesFile);43 InputStream inputStream = Routes.class.getResourceAsStream("routes.xml");44 ) {44 OutputStream outputStream = new FileOutputStream(routesFile); 45 InputStream inputStream = Routes.class.getResourceAsStream("routes.xml"); 46 ) { 45 47 byte[] b = new byte[512]; 46 48 int read; … … 84 86 isShown = true; 85 87 SwingUtilities.invokeLater(new Runnable() { 88 @Override 86 89 public void run() { 87 90 for (RouteLayer routeLayer:routeLayers) { 88 Main. main.addLayer(routeLayer);91 Main.getLayerManager().addLayer(routeLayer); 89 92 } 90 93 } … … 97 100 isShown = false; 98 101 SwingUtilities.invokeLater(new Runnable() { 102 @Override 99 103 public void run() { 100 104 for (RouteLayer routeLayer:routeLayers) { 101 Main. main.removeLayer(routeLayer);105 Main.getLayerManager().removeLayer(routeLayer); 102 106 } 103 107 } … … 107 111 } 108 112 109 public void layerAdded(Layer newLayer) { 113 @Override 114 public void layerAdded(LayerAddEvent e) { 110 115 checkLayers(); 111 116 } 112 117 113 public void layerRemoved(Layer oldLayer) { 118 @Override 119 public void layerRemoving(LayerRemoveEvent e) { 114 120 checkLayers(); 115 121 } 122 123 @Override 124 public void layerOrderChanged(LayerOrderChangeEvent e) { 125 // Do nothing 126 } 116 127 }
Note:
See TracChangeset
for help on using the changeset viewer.