Changeset 14423 in osm for applications/editors/josm/plugins
- Timestamp:
- 2009-04-08T02:23:40+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/routing/src/com/innovant/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/PreferencesKeys.java
r14287 r14423 28 28 29 29 public enum PreferencesKeys { 30 KEY_ROUTE_COLOR ("routing.route.color"), 30 KEY_ACTIVE_ROUTE_COLOR ("routing.active.route.color"), 31 KEY_INACTIVE_ROUTE_COLOR ("routing.inactive.route.color"), 31 32 KEY_ROUTE_WIDTH ("routing.route.width"), 32 33 KEY_ROUTE_SELECT ("routing.route.select"); 33 34 34 35 public final String key; 35 36 PreferencesKeys (String key) { 36 37 this.key=key; 37 38 } 38 39 39 40 public String getKey() {return key;}; 40 41 } -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java
r14404 r14423 208 208 Collection<Component> components = new ArrayList<Component>(); 209 209 components.add(new JMenuItem(new LayerListDialog.ShowHideLayerAction(this))); 210 components.add(new JMenuItem(new LayerListDialog.ShowHideMarkerText(this)));210 // components.add(new JMenuItem(new LayerListDialog.ShowHideMarkerText(this))); 211 211 components.add(new JMenuItem(new LayerListDialog.DeleteLayerAction(this))); 212 212 components.add(new JSeparator()); … … 223 223 @Override 224 224 public String getToolTipText() { 225 if (routingModel.getRouteEdges() != null) { 226 // If there's a calculated route 227 return "Showing calculated route. You can still add route nodes and compute a new route or delete layer to start a new route"; 228 } else if (routingModel.getSelectedNodes() != null) { 229 // If there are some route nodes but not a calculated route 230 return "Keep selecting route nodes and compute route"; 231 } 232 return "Select as many route nodes as you want and compute route"; 225 String tooltip = this.routingModel.routingGraph.getVertexCount() + " vertices, " 226 + this.routingModel.routingGraph.getEdgeCount() + " edges"; 227 return tooltip; 233 228 } 234 229 … … 257 252 @Override 258 253 public void paint(Graphics g, MapView mv) { 254 boolean isActiveLayer = (mv.getActiveLayer().equals(this)); 259 255 // Get routing nodes (start, middle, end) 260 256 List<Node> nodes = routingModel.getSelectedNodes(); … … 265 261 266 262 // Get path stroke color from preferences 267 // Main.pref.hasKey(PreferencesKeys.KEY_ROUTE_COLOR.key); 268 String colorString = Main.pref.get(PreferencesKeys.KEY_ROUTE_COLOR.key); 269 if(colorString.length() == 0) { 270 colorString = ColorHelper.color2html(Color.RED); 271 // FIXME add after good color is found: Main.pref.put(KEY_ROUTE_COLOR, colorString); 263 // Color is different for active and inactive layers 264 String colorString; 265 if (isActiveLayer) { 266 if (Main.pref.hasKey(PreferencesKeys.KEY_ACTIVE_ROUTE_COLOR.key)) 267 colorString = Main.pref.get(PreferencesKeys.KEY_ACTIVE_ROUTE_COLOR.key); 268 else { 269 colorString = ColorHelper.color2html(Color.RED); 270 Main.pref.put(PreferencesKeys.KEY_ACTIVE_ROUTE_COLOR.key, colorString); 271 } 272 } else { 273 if (Main.pref.hasKey(PreferencesKeys.KEY_INACTIVE_ROUTE_COLOR.key)) 274 colorString = Main.pref.get(PreferencesKeys.KEY_INACTIVE_ROUTE_COLOR.key); 275 else { 276 colorString = ColorHelper.color2html(Color.decode("#dd2222")); 277 Main.pref.put(PreferencesKeys.KEY_INACTIVE_ROUTE_COLOR.key, colorString); 278 } 272 279 } 273 280 Color color = ColorHelper.html2color(colorString); … … 275 282 // Get path stroke width from preferences 276 283 String widthString = Main.pref.get(PreferencesKeys.KEY_ROUTE_WIDTH.key); 277 if (widthString.length() == 0) {284 if (widthString.length() == 0) { 278 285 widthString = "8"; 279 286 // FIXME add after good width is found: Main.pref.put(KEY_ROUTE_WIDTH, widthString); -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java
r14404 r14423 132 132 public RoutingPlugin() { 133 133 super(); 134 //FIXME: maybe check if plugin already exists135 134 plugin = this; // Assign reference to the plugin class 136 135 DOMConfigurator.configure("log4j.xml"); … … 250 249 for (int i=0;i<layersArray.length;i++) { 251 250 if (layersArray[i].getDataLayer().equals(oldLayer)) { 252 // Move layer to the top253 Main.map.mapView.moveLayer(layersArray[i], 0);254 251 try { 255 252 // Remove layer -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java
r14404 r14423 71 71 // TODO Use constructor with shortcut 72 72 super(tr("Routing"), "add", 73 tr("Click to add route nodes."),73 tr("Click to add destination."), 74 74 mapFrame, ImageProvider.getCursor("crosshair", null)); 75 75 this.routingDialog = RoutingPlugin.getInstance().getRoutingDialog(); -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java
r14404 r14423 86 86 // TODO Use constructor with shortcut 87 87 super(tr("Routing"), "move", 88 tr("Click and drag to move route nodes."),88 tr("Click and drag to move destination"), 89 89 mapFrame, ImageProvider.getCursor("normal", "move")); 90 90 this.routingDialog = RoutingPlugin.getInstance().getRoutingDialog(); -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java
r14404 r14423 75 75 // TODO Use constructor with shortcut 76 76 super(tr("Routing"), "remove", 77 tr(" Remove route nodes"),77 tr("Click to remove destination"), 78 78 mapFrame, ImageProvider.getCursor("normal", "delete")); 79 79 this.routingDialog = RoutingPlugin.getInstance().getRoutingDialog();
Note:
See TracChangeset
for help on using the changeset viewer.