public void click(final RadialMenuItem CLICKED_ITEM) {
List<Transition> transitions = new ArrayList<>(items.size() * 2);
for (Parent node : items.keySet()) {
if (items.get(node).equals(CLICKED_ITEM)) {
// Add enlarge transition to selected item
ScaleTransition enlargeItem = new ScaleTransition(Duration.millis(300), node);
enlargeItem.setToX(5.0);
enlargeItem.setToY(5.0);
enlargeItem.setOnFinished(event -> {
node.setScaleX(1.0);
node.setScaleY(1.0);
});
transitions.add(enlargeItem);
} else {
// Add shrink transition to all other items
ScaleTransition shrinkItem = new ScaleTransition(Duration.millis(300), node);
shrinkItem.setToX(0.0);
shrinkItem.setToY(0.0);
transitions.add(shrinkItem);
}
// Add fade out transition to every node
FadeTransition fadeOutItem = new FadeTransition(Duration.millis(300), node);
fadeOutItem.setToValue(0.0);
fadeOutItem.setOnFinished(event -> {
node.setTranslateX(0);
node.setTranslateY(0);
});
transitions.add(fadeOutItem);
}
// Add rotate and fade transition to main menu button
if (options.isButtonHideOnSelect()) {
RotateTransition rotateMainButton = new RotateTransition(Duration.millis(300), mainMenuButton);
rotateMainButton.setToAngle(225);
transitions.add(rotateMainButton);
FadeTransition fadeOutMainButton = new FadeTransition(Duration.millis(300), mainMenuButton);
fadeOutMainButton.setToValue(0.0);
transitions.add(fadeOutMainButton);
ScaleTransition shrinkMainButton = new ScaleTransition(Duration.millis(300), mainMenuButton);
shrinkMainButton.setToX(0.0);
shrinkMainButton.setToY(0.0);
transitions.add(shrinkMainButton);
} else {
RotateTransition rotateBackMainButton = new RotateTransition();
rotateBackMainButton.setNode(cross);
rotateBackMainButton.setToAngle(0);