public class RouteGenerationHandler extends java.lang.Object implements RouteGenerationTask.RouteGenerationEventListener
RouteGenerationTask
. This
handler expects to be run on a UI thread.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ROUTE_GENERATED |
Constructor and Description |
---|
RouteGenerationHandler(MapView mapView,
PointMapItem origin,
PointMapItem dest,
Route route) |
Modifier and Type | Method and Description |
---|---|
android.app.ProgressDialog |
getDialog() |
void |
onAfterRouteGenerated(RoutePointPackage routePointPackage)
Fires after the route has been returned (after onRouteGenerated) and has not been cancelled.
|
void |
onBeforeRouteGenerated(RouteGenerationTask task,
boolean displayDialog)
Fires before the task is executed (NOTE: Will run on the UI thread)
|
void |
onCancelled()
Fires after the task has been cancelled.
|
void |
onException(java.lang.Exception ex)
Fires when an exception has been thrown.
|
void |
onProgressUpdated(double progress)
Fires when there is progress to report (NOTE: Will run on the UI thread).
|
void |
onRouteGenerated(RoutePointPackage routePointPackage)
Fires immediately after the route is generated (NOTE: Will run on the BACKGROUND thread).
|
public static final java.lang.String ROUTE_GENERATED
public RouteGenerationHandler(MapView mapView, PointMapItem origin, PointMapItem dest, Route route)
public void onBeforeRouteGenerated(RouteGenerationTask task, boolean displayDialog)
RouteGenerationTask.RouteGenerationEventListener
onBeforeRouteGenerated
in interface RouteGenerationTask.RouteGenerationEventListener
task
- The associated task.displayDialog
- Specify whether or not to alert the user that
a new route is being generated.public void onProgressUpdated(double progress)
RouteGenerationTask.RouteGenerationEventListener
onProgressUpdated
in interface RouteGenerationTask.RouteGenerationEventListener
progress
- A value from 0 to 1 representing the progress.public android.app.ProgressDialog getDialog()
public void onException(java.lang.Exception ex)
RouteGenerationTask.RouteGenerationEventListener
onException
in interface RouteGenerationTask.RouteGenerationEventListener
ex
- The exception that was thrown.public void onRouteGenerated(RoutePointPackage routePointPackage)
RouteGenerationTask.RouteGenerationEventListener
onRouteGenerated
in interface RouteGenerationTask.RouteGenerationEventListener
routePointPackage
- The routePointPackage that was generated.public void onAfterRouteGenerated(RoutePointPackage routePointPackage)
RouteGenerationTask.RouteGenerationEventListener
onAfterRouteGenerated
in interface RouteGenerationTask.RouteGenerationEventListener
public void onCancelled()
RouteGenerationTask.RouteGenerationEventListener
onCancelled
in interface RouteGenerationTask.RouteGenerationEventListener