assert animate;
Point location = getLocation();
Move move = new Move(x - location.getX(), y - location.getY()) {
@Override
public void tearDownEffect() {
/*
* do not super.tearDownEffects as this resets to original state
* reset root panel position as this is affected by move
*/
CSS.setLocation(rootPanel, 0, 0);
}
};
move.addEffectCompletedHandler(new EffectCompletedHandler() {
@Override
public void onEffectCompleted(EffectCompletedEvent event) {
removeEffects();
setLocation(x, y);
assert 0 == new WidgetLocation(rootPanel, WindowPanel.this)
.getLeft();
assert 0 == new WidgetLocation(rootPanel, WindowPanel.this)
.getTop();
}
});
move.setTransitionType(FXUtil.EASE_OUT);
move.setDuration(FXUtil.DEFAULT_EFFECT_DURATION);
addEffect(move);
playEffects();
}