Changeset 32447 in osm for applications/editors/josm/plugins/NanoLog
- Timestamp:
- 2016-06-29T21:16:08+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/NanoLog/src/nanolog
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogPanel.java
r32329 r32447 14 14 15 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;17 16 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 18 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; 19 22 20 23 /** … … 44 47 45 48 @Override 46 public void activeLayerChange( Layer oldLayer, Layer newLayer ) { 47 // todo 49 public void layerOrderChanged(LayerOrderChangeEvent e) { 48 50 } 49 51 50 52 @Override 51 public void layerAdded( Layer newLayer ) { 52 if( newLayer instanceof NanoLogLayer ) 53 ((NanoLogLayer)newLayer).addListener(this); 53 public void layerAdded(LayerAddEvent e) { 54 Layer newLayer = e.getAddedLayer(); 55 if (newLayer instanceof NanoLogLayer ) 56 ((NanoLogLayer) newLayer).addListener(this); 54 57 updateMarkers(); 55 58 } 56 59 57 60 @Override 58 public void layerRemov ed( Layer oldLayer) {61 public void layerRemoving(LayerRemoveEvent e) { 59 62 updateMarkers(); 60 63 } -
applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogPlugin.java
r31981 r32447 1 1 package nanolog; 2 3 import static org.openstreetmap.josm.tools.I18n.tr; 2 4 3 5 import java.awt.event.ActionEvent; 4 6 import java.io.IOException; 5 7 import java.util.List; 8 6 9 import javax.swing.JFileChooser; 7 10 import javax.swing.JOptionPane; 11 8 12 import org.openstreetmap.josm.Main; 9 13 import org.openstreetmap.josm.actions.JosmAction; 10 14 import org.openstreetmap.josm.gui.MapFrame; 11 import org.openstreetmap.josm.gui.MapView;12 15 import org.openstreetmap.josm.plugins.Plugin; 13 16 import org.openstreetmap.josm.plugins.PluginInformation; 14 import static org.openstreetmap.josm.tools.I18n.tr;15 17 16 18 /** … … 30 32 NanoLogPanel panel = new NanoLogPanel(); 31 33 newFrame.addToggleDialog(panel); 32 Ma pView.addLayerChangeListener(panel);34 Main.getLayerManager().addLayerChangeListener(panel); 33 35 } 34 36 } … … 47 49 if( !entries.isEmpty() ) { 48 50 NanoLogLayer layer = new NanoLogLayer(entries); 49 Main. main.addLayer(layer);51 Main.getLayerManager().addLayer(layer); 50 52 layer.setupListeners(); 51 53 }
Note:
See TracChangeset
for help on using the changeset viewer.