use of aimax.osm.data.OsmMap in project aima-java by aimacode.
the class OsmRoutePlannerApp method calculateRoute.
/** Starts route generation after the calculate button has been pressed. */
public void calculateRoute() {
OsmMap map = mapPaneCtrl.getMap();
List<Position> positions = routeCalculator.calculateRoute(map.getMarkers(), map, taskCombo.getSelectionModel().getSelectedIndex());
mapPaneCtrl.getMap().createTrack("Route", positions);
statusLabel.setText(getTrackInfo(mapPaneCtrl.getMap().getTrack("Route")));
}
use of aimax.osm.data.OsmMap in project aima-java by aimacode.
the class MapViewPane method setMap.
/** Sets the map as model of this pane and initiates painting. */
public void setMap(OsmMap map) {
OsmMap oldMap = imageUpdater.getMap();
if (oldMap != null)
oldMap.removeMapDataEventListener(this);
imageUpdater.setMap(map);
if (map != null) {
map.addMapDataEventListener(this);
isAdjusted = false;
}
viewChanged(MapViewEvent.Type.NEW_MAP);
}
use of aimax.osm.data.OsmMap in project aima-java by aimacode.
the class RoutePlannerApp method actionPerformed.
/** Starts route generation after the calculate button has been pressed. */
public void actionPerformed(ActionEvent e) {
if (e.getSource() == calcButton) {
OsmMap map = frame.getMap();
List<Position> positions = routeCalculator.calculateRoute(map.getMarkers(), map, taskSelection.getSelectedIndex());
frame.getMap().createTrack(ROUTE_TRACK_NAME, positions);
}
}