@Override
public boolean handleMessage(Message msg) {
if (this.animationAmount < 1) {
this.animationAmount += this.animationIncrement;
for (int idx = 0, len = this.flightPathLayer.count(); idx < len; idx++) {
Path path = (Path) this.flightPathLayer.getRenderable(idx);
Airport dept = (Airport) path.getUserProperty("dept");
Airport dest = (Airport) path.getUserProperty("dest");
Position nextPos = dept.pos.interpolateAlongPath(dest.pos, WorldWind.GREAT_CIRCLE, this.animationAmount, new Position());
double dist = dept.pos.greatCircleDistance(dest.pos) * this.getWorldWindow().getGlobe().getEquatorialRadius();
double altCurve = (1 - this.animationAmount) * this.animationAmount * 4;
nextPos.altitude = altCurve * dist * 0.1;
List<Position> positions = path.getPositions();
positions.add(nextPos);
path.setPositions(positions);
}
this.getWorldWindow().requestRedraw();
this.handler.sendEmptyMessageDelayed(0 , 1000);
}
return false;
}