Changeset 32450 in osm for applications
- Timestamp:
- 2016-06-29T21:38:48+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/OsmInspectorPlugin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/OsmInspectorPlugin/build.xml
r30828 r32450 5 5 <property name="commit.message" value="Commit message"/> 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 <property name="plugin.author" value="Nikhil Shirahatti"/> -
applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/ImportOsmInspectorBugsAction.java
r30815 r32450 6 6 import java.awt.event.ActionEvent; 7 7 import java.awt.event.KeyEvent; 8 import java.io.IOException; 9 import java.util.NoSuchElementException; 8 10 9 11 import javax.swing.ProgressMonitor; 10 12 13 import org.opengis.referencing.FactoryException; 11 14 import org.openstreetmap.josm.Main; 12 15 import org.openstreetmap.josm.actions.JosmAction; 13 16 import org.openstreetmap.josm.data.Bounds; 14 17 import org.openstreetmap.josm.tools.Shortcut; 18 19 import com.vividsolutions.jts.io.ParseException; 15 20 16 21 public class ImportOsmInspectorBugsAction extends JosmAction { … … 49 54 wfs.initializeDataStore(); 50 55 inspector = new OsmInspectorLayer(wfs, monitor); 51 Main. main.addLayer(inspector);56 Main.getLayerManager().addLayer(inspector); 52 57 plugin.setLayer(inspector); 53 58 } else { … … 57 62 58 63 } 59 } catch (Exception e) { 60 // TODO Auto-generated catch block 61 e.printStackTrace(); 64 } catch (IOException | IndexOutOfBoundsException | NoSuchElementException | FactoryException | ParseException e) { 65 Main.error(e); 62 66 } finally { 63 67 monitor.close(); -
applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OsmInspectorPlugin.java
r30815 r32450 13 13 import org.openstreetmap.josm.gui.JosmUserIdentityManager; 14 14 import org.openstreetmap.josm.gui.MapFrame; 15 import org.openstreetmap.josm.gui.MapView;16 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;17 15 import org.openstreetmap.josm.gui.NavigatableComponent; 18 16 import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener; 19 17 import org.openstreetmap.josm.gui.download.DownloadDialog; 20 18 import org.openstreetmap.josm.gui.download.DownloadSelection; 21 import org.openstreetmap.josm.gui.layer.Layer;22 19 import org.openstreetmap.josm.plugins.Plugin; 23 20 import org.openstreetmap.josm.plugins.PluginInformation; … … 25 22 26 23 public class OsmInspectorPlugin extends Plugin 27 implements LayerChangeListener,ZoomChangeListener,24 implements ZoomChangeListener, 28 25 MouseListener, PreferenceChangedListener, DownloadSelection{ 29 26 … … 66 63 if (newFrame == null) { 67 64 /* if new MapFrame is null, remove listener */ 68 MapView.removeLayerChangeListener(this);69 65 NavigatableComponent.removeZoomChangeListener(this); 70 66 } else { … … 76 72 /* add Listeners */ 77 73 NavigatableComponent.addZoomChangeListener(this); 78 MapView.addLayerChangeListener(this);79 74 Main.map.mapView.addMouseListener(this); 80 75 Main.pref.addPreferenceChangeListener(this); … … 85 80 } 86 81 } 87 }88 89 @Override90 public void activeLayerChange(Layer oldLayer, Layer newLayer) {91 92 }93 94 @Override95 public void layerAdded(Layer newLayer) {96 97 }98 99 @Override100 public void layerRemoved(Layer oldLayer) {101 102 82 } 103 83 … … 152 132 } 153 133 154 155 156 157 134 @Override 158 135 public void addGui(DownloadDialog gui) { 159 136 // TODO Auto-generated method stub 160 161 137 } 162 163 164 165 138 166 139 @Override 167 140 public void setDownloadArea(Bounds bounds) { 168 141 // TODO Auto-generated method stub 169 170 142 } 171 143 } -
applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorBugInfoDialog.java
r30815 r32450 4 4 5 5 import java.awt.event.KeyEvent; 6 import java.awt.event.MouseEvent;7 import java.awt.event.MouseListener;8 6 import java.util.Arrays; 9 7 10 8 import javax.swing.JTextPane; 11 import javax.swing.event.ListSelectionEvent;12 import javax.swing.event.ListSelectionListener;13 9 14 10 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;16 11 import org.openstreetmap.josm.gui.SideButton; 17 12 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 18 import org.openstreetmap.josm.gui.layer.Layer;19 13 import org.openstreetmap.josm.plugins.osminspector.OsmInspectorLayer; 20 14 import org.openstreetmap.josm.plugins.osminspector.OsmInspectorLayer.BugInfo; 21 15 import org.openstreetmap.josm.tools.Shortcut; 22 16 23 public class OsmInspectorBugInfoDialog extends ToggleDialog implements 24 ListSelectionListener, LayerChangeListener, MouseListener { 17 public class OsmInspectorBugInfoDialog extends ToggleDialog { 25 18 26 19 private JTextPane bugTextArea; … … 63 56 } 64 57 } 65 66 @Override67 public void mouseClicked(MouseEvent e) {68 }69 70 @Override71 public void mouseEntered(MouseEvent e) {72 }73 74 @Override75 public void mouseExited(MouseEvent e) {76 }77 78 @Override79 public void mousePressed(MouseEvent e) {80 }81 82 @Override83 public void mouseReleased(MouseEvent e) {84 }85 86 @Override87 public void activeLayerChange(Layer oldLayer, Layer newLayer) {88 }89 90 @Override91 public void layerAdded(Layer layer) {92 }93 94 @Override95 public void layerRemoved(Layer arg0) {96 }97 98 @Override99 public void valueChanged(ListSelectionEvent e) {100 }101 58 } -
applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorDialog.java
r31661 r32450 6 6 import java.awt.event.ActionListener; 7 7 import java.awt.event.KeyEvent; 8 import java.awt.event.MouseEvent;9 import java.awt.event.MouseListener;10 8 import java.util.Arrays; 11 9 … … 21 19 import org.openstreetmap.josm.Main; 22 20 import org.openstreetmap.josm.data.coor.LatLon; 23 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;24 21 import org.openstreetmap.josm.gui.SideButton; 25 22 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 26 23 import org.openstreetmap.josm.gui.layer.Layer; 24 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; 25 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener; 26 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; 27 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; 28 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 29 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 27 30 import org.openstreetmap.josm.plugins.osminspector.OsmInspectorLayer; 28 31 import org.openstreetmap.josm.plugins.osminspector.OsmInspectorLayer.BugInfo; … … 32 35 import com.vividsolutions.jts.geom.Point; 33 36 34 public class OsmInspectorDialog extends ToggleDialog implements 35 ListSelectionListener, LayerChangeListener, MouseListener { 37 public class OsmInspectorDialog extends ToggleDialog implements LayerChangeListener, ActiveLayerChangeListener { 36 38 37 39 private OsmInspectorLayer layer; … … 85 87 final SideButton nextButton = new SideButton( 86 88 actNext = new OsmInspectorNextAction(layer)); 87 bugsList.getSelectionModel().addListSelectionListener(actNext);88 89 nextButton.createArrow(new ActionListener() { 89 90 public void actionPerformed(ActionEvent e) { … … 160 161 } 161 162 162 public class OsmInspectorNextAction extends AbstractAction implements 163 ListSelectionListener { 163 public class OsmInspectorNextAction extends AbstractAction { 164 164 165 165 private OsmInspectorLayer inspectlayer; … … 182 182 updateSelection(next); 183 183 } 184 185 @Override186 public void valueChanged(ListSelectionEvent arg0) {187 }188 184 } 189 185 … … 195 191 } 196 192 197 private class OsmInspectorPrevAction extends AbstractAction implements 198 ListSelectionListener { 193 private class OsmInspectorPrevAction extends AbstractAction { 199 194 200 195 private OsmInspectorLayer inspectlayer; … … 217 212 updateSelection(prev); 218 213 } 219 220 @Override 221 public void valueChanged(ListSelectionEvent e) { 222 } 223 } 224 225 @Override 226 public void mouseClicked(MouseEvent e) { 227 } 228 229 @Override 230 public void mouseEntered(MouseEvent e) { 231 } 232 233 @Override 234 public void mouseExited(MouseEvent e) { 235 } 236 237 @Override 238 public void mousePressed(MouseEvent e) { 239 } 240 241 @Override 242 public void mouseReleased(MouseEvent e) { 243 } 244 245 @Override 246 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 214 } 215 216 @Override 217 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 218 Layer newLayer = Main.getLayerManager().getActiveLayer(); 247 219 if (newLayer instanceof OsmInspectorLayer) { 248 220 this.layer = (OsmInspectorLayer) newLayer; … … 258 230 259 231 @Override 260 public void layerAdded(Layer layer) {232 public void layerAdded(LayerAddEvent e) { 261 233 if (layer instanceof OsmInspectorLayer) { 262 234 refreshModel(); … … 266 238 267 239 @Override 268 public void layerRemov ed(Layer arg0) {240 public void layerRemoving(LayerRemoveEvent e) { 269 241 if (layer instanceof OsmInspectorLayer) { 270 242 bugsList.clearSelection(); … … 273 245 } 274 246 275 @Override 276 public void valueChanged(ListSelectionEvent e) { 277 278 } 247 @Override 248 public void layerOrderChanged(LayerOrderChangeEvent e) { 249 } 279 250 }
Note:
See TracChangeset
for help on using the changeset viewer.