/**
* adds the change listeners to the {@link MiniIconButton} properties
*/
private void addChangeListeners() {
final MiniIconButton miniIconButton = (MiniIconButton)getSkinnable();
miniIconButton.animationDurationProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(final ObservableValue<? extends Number> observableValue,
final Number oldDuraction,
final Number newDuration) {
stopAnimation(miniIconButton);
configureJumping(miniIconButton);
configureBlinking(miniIconButton);
startAnimation(miniIconButton);
getSkinnable().requestLayout();
}
});
miniIconButton.animationTypeProperty().addListener(new ChangeListener<MiniIconButton.AnimationType>() {
@Override
public void changed(final ObservableValue<? extends MiniIconButton.AnimationType> observableValue,
final MiniIconButton.AnimationType oldAnimationType,
final MiniIconButton.AnimationType newAnimationType) {
startAnimation(miniIconButton);
getSkinnable().requestLayout();
}
});
miniIconButton.miniIconPositionProperty().addListener(new ChangeListener<Pos>() {
@Override
public void changed(final ObservableValue<? extends Pos> observableValue,
final Pos oldPosition,
final Pos newPosition) {
StackPane.setAlignment(miniIconButton.getMiniIcon(), newPosition);
getSkinnable().requestLayout();
}
});
miniIconButton.miniIconProperty().addListener(new ChangeListener<ImageView>() {
@Override
public void changed(final ObservableValue<? extends ImageView> observableValue,
final ImageView oldMiniIcon,
final ImageView newMiniIcon) {
stopAnimation(miniIconButton);
changeMiniIcon(oldMiniIcon, newMiniIcon);
positionMiniIcon(miniIconButton);
configureJumping(miniIconButton);
configureBlinking(miniIconButton);
calculateAndSetNewMiniIconSize(miniIconButton);
startAnimation(miniIconButton);
getSkinnable().requestLayout();
}
});
miniIconButton.miniIconRatioProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(final ObservableValue<? extends Number> observableValue,
final Number oldNumber,
final Number newNumber) {
stopAnimation(miniIconButton);