Changeset 32456 in osm for applications/editors/josm/plugins
- Timestamp:
- 2016-06-30T00:16:11+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/routes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routes/.settings/org.eclipse.jdt.ui.prefs
r30738 r32456 7 7 sp_cleanup.add_missing_methods=false 8 8 sp_cleanup.add_missing_nls_tags=false 9 sp_cleanup.add_missing_override_annotations= false10 sp_cleanup.add_missing_override_annotations_interface_methods= false9 sp_cleanup.add_missing_override_annotations=true 10 sp_cleanup.add_missing_override_annotations_interface_methods=true 11 11 sp_cleanup.add_serial_version_id=false 12 12 sp_cleanup.always_use_blocks=true … … 16 16 sp_cleanup.convert_functional_interfaces=false 17 17 sp_cleanup.convert_to_enhanced_for_loop=false 18 sp_cleanup.correct_indentation= false18 sp_cleanup.correct_indentation=true 19 19 sp_cleanup.format_source_code=false 20 20 sp_cleanup.format_source_code_changes_only=false -
applications/editors/josm/plugins/routes/build.xml
r32329 r32456 2 2 <project name="routes" default="dist" basedir="."> 3 3 <property name="commit.message" value="Changed the constructor signature of the plugin main class"/> 4 <property name="plugin.main.version" value="10 279"/>4 <property name="plugin.main.version" value="10353"/> 5 5 <property name="josm" location="../../core/dist/josm-custom.jar"/> 6 6 <property name="plugin.dist.dir" value="../../dist"/> -
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.