scale = easing.easeIn(getElapsedTime(), 1, -1, getDuration());
} else {
scale = easing.easeOut(getElapsedTime(), 1, -1, getDuration());
}
Display display = sheet.getDisplay();
if (display != null) {
Bounds decoratedBounds = sheet.getDecoratedBounds();
display.repaint(decoratedBounds.x, decoratedBounds.y,
decoratedBounds.width + dx, decoratedBounds.height + dy);
Dimensions size = sheet.getPreferredSize();
switch (slideSource) {
case NORTH:
dy = -(int)(size.height * scale);
break;
case EAST:
dx = (int)(size.width * scale);
break;
case SOUTH:
dy = (int)(size.height * scale);
break;
case WEST:
dx = -(int)(size.width * scale);
break;
default:
throw new IllegalStateException(
"slideSource is null or an unexpected value");
}
translationDecorator.setX(dx);
translationDecorator.setY(dy);
display.repaint(decoratedBounds.x, decoratedBounds.y,
decoratedBounds.width + dx, decoratedBounds.height + dy);
}
}