Search in sources :

Example 1 with OsmMap

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")));
}
Also used : OsmMap(aimax.osm.data.OsmMap) Position(aimax.osm.data.Position)

Example 2 with OsmMap

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);
}
Also used : OsmMap(aimax.osm.data.OsmMap)

Example 3 with OsmMap

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);
    }
}
Also used : OsmMap(aimax.osm.data.OsmMap) Position(aimax.osm.data.Position)

Aggregations

OsmMap (aimax.osm.data.OsmMap)3 Position (aimax.osm.data.Position)2