Changeset 32518 in osm for applications/editors/josm
- Timestamp:
- 2016-07-02T00:22:51+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/wms-turbo-challenge2
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wms-turbo-challenge2/.settings/org.eclipse.jdt.core.prefs
r30736 r32518 81 81 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 82 82 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 83 org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore 83 84 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 84 85 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -
applications/editors/josm/plugins/wms-turbo-challenge2/src/wmsturbochallenge/GameWindow.java
r32322 r32518 130 130 new HashMap<String, Object>())); 131 131 132 ground_view.parent. addLayer(132 ground_view.parent.getLayerManager().addLayer( 133 133 new GpxLayer(data, "Car GPS trace")); 134 134 } -
applications/editors/josm/plugins/wms-turbo-challenge2/src/wmsturbochallenge/WMSRacer.java
r32322 r32518 16 16 import org.openstreetmap.josm.actions.JosmAction; 17 17 import org.openstreetmap.josm.gui.MapFrame; 18 import org.openstreetmap.josm.gui.MapView;19 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;20 18 import org.openstreetmap.josm.gui.layer.Layer; 19 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; 20 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener; 21 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; 22 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; 23 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 24 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 21 25 import org.openstreetmap.josm.plugins.Plugin; 22 26 import org.openstreetmap.josm.plugins.PluginInformation; 23 27 24 public class WMSRacer extends Plugin implements LayerChangeListener {28 public class WMSRacer extends Plugin implements LayerChangeListener, ActiveLayerChangeListener { 25 29 public WMSRacer(PluginInformation info) { 26 30 super(info); … … 47 51 } 48 52 53 @Override 49 54 public void actionPerformed(ActionEvent ev) { 50 55 if (groundLayer == null || … … 55 60 } 56 61 62 @Override 57 63 public void updateEnabledState() { 58 64 if (frame == null) { … … 80 86 * horizontal scanlines (lines equidistant from 81 87 * camera eye)) */ 82 for (Layer l : frame.mapView.get AllLayers())88 for (Layer l : frame.mapView.getLayerManager().getLayers()) 83 89 if (l.isBackgroundLayer()) { 84 90 groundLayer = l; … … 94 100 protected DriveAction driveAction = new DriveAction(); 95 101 102 @Override 96 103 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 97 if (oldFrame != null) 98 MapView.removeLayerChangeListener(this); 104 if (oldFrame != null) { 105 Main.getLayerManager().removeLayerChangeListener(this); 106 Main.getLayerManager().removeActiveLayerChangeListener(this); 107 } 99 108 100 109 driveAction.frame = newFrame; 101 110 driveAction.updateEnabledState(); 102 111 103 if (newFrame != null) 104 MapView.addLayerChangeListener(this); 112 if (newFrame != null) { 113 Main.getLayerManager().addLayerChangeListener(this); 114 Main.getLayerManager().addActiveLayerChangeListener(this); 115 } 105 116 } 106 117 107 /* LayerChangeListener methods */108 public void active LayerChange(Layer oldLayer, Layer newLayer) {109 driveAction.currentLayer = newLayer;118 @Override 119 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 120 driveAction.currentLayer = Main.getLayerManager().getActiveLayer(); 110 121 driveAction.updateEnabledState(); 111 122 } 112 123 113 public void layerAdded(Layer newLayer) { 124 @Override 125 public void layerAdded(LayerAddEvent e) { 114 126 driveAction.updateEnabledState(); 115 127 } 116 128 117 public void layerRemoved(Layer oldLayer) { 129 @Override 130 public void layerRemoving(LayerRemoveEvent e) { 118 131 driveAction.updateEnabledState(); 119 132 } 133 134 @Override 135 public void layerOrderChanged(LayerOrderChangeEvent e) { 136 // Do nothing 137 } 120 138 }
Note:
See TracChangeset
for help on using the changeset viewer.