Changeset 27288 in osm
- Timestamp:
- 2011-12-20T21:40:05+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/routing
- Files:
-
- 3 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routing/build.xml
r27269 r27288 27 27 <project name="routing" default="dist" basedir="."> 28 28 <property name="commit.message" value="fixed NPE at startup"/> 29 <property name="plugin.main.version" value="466 6"/>29 <property name="plugin.main.version" value="4669"/> 30 30 <!-- Define some properties --> 31 31 <property name="josm" location="../../core/dist/josm-custom.jar"/> -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java
r27269 r27288 195 195 removeRouteNodeButton = new IconToggleButton(removeRouteNodeAction); 196 196 moveRouteNodeButton = new IconToggleButton(moveRouteNodeAction); 197 addRouteNodeButton.setAutoHideDisabledButton(true); 198 removeRouteNodeButton.setAutoHideDisabledButton(true); 199 moveRouteNodeButton.setAutoHideDisabledButton(true); 197 200 newFrame.addMapMode(addRouteNodeButton); 198 201 newFrame.addMapMode(removeRouteNodeButton); 199 202 newFrame.addMapMode(moveRouteNodeButton); 200 // newFrame.toolGroup.add(addRouteNodeButton);201 // newFrame.toolGroup.add(removeRouteNodeButton);202 // newFrame.toolGroup.add(moveRouteNodeButton);203 // Hide them by default204 addRouteNodeButton.setVisible(false);205 removeRouteNodeButton.setVisible(false);206 moveRouteNodeButton.setVisible(false);207 203 // Enable menu 208 204 menu.enableStartItem(); … … 216 212 */ 217 213 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 218 if (addRouteNodeButton==null) return;219 214 if (newLayer instanceof RoutingLayer) { /* show Routing toolbar and dialog window */ 220 addRouteNodeButton.setVisible(true);221 removeRouteNodeButton.setVisible(true);222 moveRouteNodeButton.setVisible(true);223 215 menu.enableRestOfItems(); 224 216 routingDialog.showDialog(); 225 217 routingDialog.refresh(); 226 218 }else{ /* hide Routing toolbar and dialog window */ 227 addRouteNodeButton.setVisible(false);228 removeRouteNodeButton.setVisible(false);229 moveRouteNodeButton.setVisible(false);230 219 menu.disableRestOfItems(); 231 220 routingDialog.hideDialog(); … … 240 229 // Add button(s) to the tool bar when the routing layer is added 241 230 if (newLayer instanceof RoutingLayer) { 242 addRouteNodeButton.setVisible(true);243 removeRouteNodeButton.setVisible(true);244 moveRouteNodeButton.setVisible(true);245 231 menu.enableRestOfItems(); 246 232 // Set layer on top and select layer, also refresh toggleDialog to reflect selection -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java
r15707 r27288 38 38 import org.openstreetmap.josm.gui.MapFrame; 39 39 import org.openstreetmap.josm.tools.ImageProvider; 40 41 import org.openstreetmap.josm.gui.layer.Layer; 40 42 41 43 import com.innovant.josm.plugin.routing.RoutingLayer; … … 105 107 Main.map.repaint(); 106 108 } 107 109 @Override public boolean layerIsSupported(Layer l) { 110 return l instanceof RoutingLayer; 111 } 108 112 } -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java
r16294 r27288 40 40 import org.openstreetmap.josm.gui.MapFrame; 41 41 import org.openstreetmap.josm.tools.ImageProvider; 42 43 import org.openstreetmap.josm.gui.layer.Layer; 42 44 43 45 import com.innovant.josm.plugin.routing.RoutingLayer; … … 154 156 } 155 157 } 158 @Override public boolean layerIsSupported(Layer l) { 159 return l instanceof RoutingLayer; 160 } 161 156 162 } -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java
r16294 r27288 39 39 import org.openstreetmap.josm.gui.MapFrame; 40 40 import org.openstreetmap.josm.tools.ImageProvider; 41 import org.openstreetmap.josm.gui.layer.Layer; 41 42 42 43 import com.innovant.josm.plugin.routing.RoutingLayer; … … 122 123 } 123 124 125 @Override public boolean layerIsSupported(Layer l) { 126 return l instanceof RoutingLayer; 127 } 128 124 129 }
Note:
See TracChangeset
for help on using the changeset viewer.