public void handleTortoiseEvent(final ITortoiseEvent event) {
boolean _matched = false;
if (!_matched) {
if (event instanceof MoveEvent) {
_matched=true;
Tortoise _tortoise = ((MoveEvent)event).getTortoise();
boolean _isPaint = _tortoise.isPaint();
if (_isPaint) {
final Polyline line = new Polyline();
Tortoise _tortoise_1 = ((MoveEvent)event).getTortoise();
Color _lineColor = _tortoise_1.getLineColor();
line.setForegroundColor(_lineColor);
Tortoise _tortoise_2 = ((MoveEvent)event).getTortoise();
int _lineWidth = _tortoise_2.getLineWidth();
line.setLineWidth(_lineWidth);
Point _oldPosition = ((MoveEvent)event).getOldPosition();
Point _oldPosition_1 = ((MoveEvent)event).getOldPosition();
line.setEndpoints(_oldPosition, _oldPosition_1);
Point _oldPosition_2 = ((MoveEvent)event).getOldPosition();
Tortoise _tortoise_3 = ((MoveEvent)event).getTortoise();
Point _position = _tortoise_3.getPosition();
Tortoise _tortoise_4 = ((MoveEvent)event).getTortoise();
int _delay = _tortoise_4.getDelay();
Animation _animation = new Animation(_oldPosition_2, _position, line, _delay);
this.animator.addAnimation(_animation);
} else {
Point _oldPosition_3 = ((MoveEvent)event).getOldPosition();
Tortoise _tortoise_5 = ((MoveEvent)event).getTortoise();
Point _position_1 = _tortoise_5.getPosition();
Tortoise _tortoise_6 = ((MoveEvent)event).getTortoise();
int _delay_1 = _tortoise_6.getDelay();
Animation _animation_1 = new Animation(_oldPosition_3, _position_1, _delay_1);
this.animator.addAnimation(_animation_1);
}
}
}
if (!_matched) {
if (event instanceof TurnEvent) {
_matched=true;
double _oldAngle = ((TurnEvent)event).getOldAngle();
Tortoise _tortoise = ((TurnEvent)event).getTortoise();
double _angleInRadians = _tortoise.getAngleInRadians();
Tortoise _tortoise_1 = ((TurnEvent)event).getTortoise();
int _delay = _tortoise_1.getDelay();
Animation _animation = new Animation(_oldAngle, _angleInRadians, _delay);
this.animator.addAnimation(_animation);
}
}
}