Changeset 32329 in osm for applications/editors/josm/plugins/routing/src/com
- Timestamp:
- 2016-06-19T16:08:56+02:00 (9 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/RoutingGraph.java
r30737 r32329 350 350 Graph<Node,OsmEdge> g; 351 351 double totalWeight = 0; 352 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();352 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 353 353 RoutingModel routingModel = layer.getRoutingModel(); 354 354 -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java
r29586 r32329 83 83 // Search for nearest highway node 84 84 Node node = null; 85 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {86 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();85 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 86 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 87 87 node = layer.getNearestHighwayNode(e.getPoint()); 88 88 if(node == null) { -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java
r29595 r32329 96 96 // If left button is pressed 97 97 if (e.getButton() == MouseEvent.BUTTON1) { 98 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {98 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 99 99 requestFocusInMapView(); 100 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();100 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 101 101 RoutingModel routingModel = layer.getRoutingModel(); 102 102 // Search for the nearest node in the list … … 129 129 130 130 private void searchAndReplaceNode(Point point) { 131 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {132 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();131 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 132 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 133 133 RoutingModel routingModel = layer.getRoutingModel(); 134 134 RoutingDialog routingDialog = RoutingPlugin.getInstance().getRoutingDialog(); -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java
r29586 r32329 84 84 // If left button is clicked 85 85 if (e.getButton() == MouseEvent.BUTTON1) { 86 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {87 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();86 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 87 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 88 88 RoutingModel routingModel = layer.getRoutingModel(); 89 89 // Search for the nearest node in the list -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java
r30532 r32329 131 131 public void refresh() { 132 132 clearNodes(); 133 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {134 RoutingLayer routingLayer = (RoutingLayer)Main. map.mapView.getActiveLayer();133 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 134 RoutingLayer routingLayer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 135 135 RoutingModel routingModel = routingLayer.getRoutingModel(); 136 136 for (Node n : routingModel.getSelectedNodes()) { -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingMenu.java
r31646 r32329 93 93 rshorter.addItemListener(new ItemListener() { 94 94 public void itemStateChanged(ItemEvent e) { 95 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {96 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();95 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 96 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 97 97 RoutingModel routingModel = layer.getRoutingModel(); 98 98 if (e.getStateChange()==ItemEvent.SELECTED) { … … 122 122 cbmi.addItemListener(new ItemListener() { 123 123 public void itemStateChanged(ItemEvent e) { 124 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {125 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();124 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 125 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 126 126 RoutingModel routingModel = layer.getRoutingModel(); 127 127 if (e.getStateChange()==ItemEvent.SELECTED) … … 142 142 reverseMI.addActionListener(new ActionListener() { 143 143 public void actionPerformed(ActionEvent e) { 144 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {145 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();144 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 145 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 146 146 RoutingModel routingModel = layer.getRoutingModel(); 147 147 routingModel.reverseNodes(); … … 155 155 clearMI.addActionListener(new ActionListener() { 156 156 public void actionPerformed(ActionEvent e) { 157 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {158 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();157 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 158 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 159 159 RoutingModel routingModel = layer.getRoutingModel(); 160 160 // Reset routing nodes and paths … … 171 171 public void actionPerformed(ActionEvent e) { 172 172 173 if (Main. map.mapView.getActiveLayer() instanceof RoutingLayer) {174 RoutingLayer layer = (RoutingLayer)Main. map.mapView.getActiveLayer();173 if (Main.getLayerManager().getActiveLayer() instanceof RoutingLayer) { 174 RoutingLayer layer = (RoutingLayer)Main.getLayerManager().getActiveLayer(); 175 175 RoutingModel routingModel = layer.getRoutingModel(); 176 176 routingModel.routingGraph.resetGraph();
Note:
See TracChangeset
for help on using the changeset viewer.