if (to == null) {
statusLabel_.setText("Cannot perform query: missing destination");
return;
}
FlightDijkstra alg = new FlightDijkstra();
int time = (queryData_.getHour()%12) * 60 + queryData_.getMinute();
if (queryData_.getAmpm() == QueryData.QD_PM) {
time += 60*12;
}
time = StandardOps.toGMT(time, ((AirportSpecs)from.element()).GMToffset());
alg.execute(dataSet_, from, to, time);
try {
queryData_.setPath(alg.reportPath());
int t = alg.distance(to);
statusLabel_.setText("Path of length " + ((t - (t%60))/60) + " hours " + (t%60) + " minutes found");
} catch (InvalidQueryException iqe){
statusLabel_.setText("No path exists between " + ((AirportSpecs)from.element()).code() +
" and " + ((AirportSpecs)to.element()).code());
queryData_.setFrom(null);
queryData_.setTo(null);
}
alg.cleanup();
updatePanel_.updatedQueryData();
}