Changeset 28624 in osm for applications/editors/josm/plugins/routing
- Timestamp:
- 2012-08-24T13:41:33+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java
r28568 r28624 79 79 * The side dialog where nodes are listed 80 80 */ 81 private finalRoutingDialog routingDialog;81 private RoutingDialog routingDialog; 82 82 83 83 /** … … 147 147 logger.debug("Loading routing plugin..."); 148 148 preferenceSettings=new RoutingPreferenceDialog(); 149 // Create side dialog150 routingDialog = new RoutingDialog();151 149 // Initialize layers list 152 150 layers = new ArrayList<RoutingLayer>(); … … 188 186 @Override 189 187 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 190 if (newFrame != null) {188 if (newFrame != null) { 191 189 // Create plugin map modes 192 190 addRouteNodeAction = new AddRouteNodeAction(newFrame); … … 205 203 // Enable menu 206 204 menu.enableStartItem(); 207 newFrame.addToggleDialog(routingDialog); 205 newFrame.addToggleDialog(routingDialog = new RoutingDialog()); 206 } else { 207 addRouteNodeAction = null; 208 removeRouteNodeAction = null; 209 moveRouteNodeAction = null; 210 addRouteNodeButton = null; 211 removeRouteNodeButton = null; 212 moveRouteNodeButton = null; 213 routingDialog = null; 208 214 } 209 215 } … … 216 222 if (newLayer instanceof RoutingLayer) { /* show Routing toolbar and dialog window */ 217 223 menu.enableRestOfItems(); 218 routingDialog.showDialog(); 219 routingDialog.refresh(); 224 if (routingDialog != null) { 225 routingDialog.showDialog(); 226 routingDialog.refresh(); 227 } 220 228 }else{ /* hide Routing toolbar and dialog window */ 221 229 menu.disableRestOfItems(); 222 routingDialog.hideDialog(); 230 if (routingDialog != null) { 231 routingDialog.hideDialog(); 232 } 223 233 } 224 234 } … … 267 277 } 268 278 // Reload RoutingDialog table model 269 routingDialog.refresh(); 279 if (routingDialog != null) { 280 routingDialog.refresh(); 281 } 270 282 } 271 283
Note:
See TracChangeset
for help on using the changeset viewer.