// the animated fill
Stop[] stops0 = new Stop[] { new Stop(0.0f, Color.rgb(176, 176, 176)), new Stop(1f, Color.rgb(207, 207,
207)) };
LinearGradient gradient0 = new LinearGradient(0.0, 0.0, 0.0, 1.0, true, CycleMethod.NO_CYCLE, stops0);
BackgroundFill backkgroudFill0 = new BackgroundFill(gradient0, new CornerRadii(2.0), new Insets(0));
list.add(backkgroudFill0);
Stop[] stops1 = new Stop[] { new Stop(0.5f, Color.rgb(84, 169, 239)), new Stop(0.5f, Color.rgb(236, 236,
236)) };
LinearGradient gradient1 = new LinearGradient(startX, 0.45, endX, 0.0, true, CycleMethod.REFLECT, stops1);
BackgroundFill backkgroudFill1 = new BackgroundFill(gradient1, new CornerRadii(2.0), new Insets(1));
list.add(backkgroudFill1);
Stop[] stops2 = new Stop[] { new Stop(0.05f, Color.rgb(255, 255, 255, 0.7)), new Stop(0.05f, Color.rgb(
255, 255, 255, 0.55)), new Stop(0.5f, Color.rgb(255, 255, 255, 0.1)), new Stop(0.5f, Color.rgb(
255, 255, 255, 0.0)), new Stop(0.6f, Color.rgb(255, 255, 255, 0.0)), new Stop(0.85f, Color.rgb(
255, 255, 255, 0.4)), new Stop(1f, Color.rgb(245, 245, 245, 0.7)) };
LinearGradient gradient2 = new LinearGradient(0.0, 0.0, 0.0, 1.0, true, CycleMethod.NO_CYCLE, stops2);
BackgroundFill backkgroudFill2 = new BackgroundFill(gradient2, new CornerRadii(2.0), new Insets(0));
list.add(backkgroudFill2);
getSkinnable().setBackground(new Background(list, null));
}
});
indeterminateProgressTransition.play();
}
} else {
List<BackgroundFill> list = new ArrayList<>();
Stop[] stops0 = new Stop[] { new Stop(0.0f, Color.rgb(176, 176, 176)), new Stop(1f, Color.rgb(207, 207, 207)) };
LinearGradient gradient0 = new LinearGradient(0.0, 0.0, 0.0, 1.0, true, CycleMethod.NO_CYCLE, stops0);
BackgroundFill backkgroudFill0 = new BackgroundFill(gradient0, new CornerRadii(2.0), new Insets(0));
list.add(backkgroudFill0);
Stop[] stops1 = new Stop[] { new Stop(0.5f, Color.rgb(84, 169, 239)), new Stop(0.5f, Color.rgb(236, 236, 236)) };
LinearGradient gradient1 = new LinearGradient(0.0, 0.45, 0.05, 0.0, true, CycleMethod.REFLECT, stops1);
BackgroundFill backkgroudFill1 = new BackgroundFill(gradient1, new CornerRadii(2.0), new Insets(1));
list.add(backkgroudFill1);
Stop[] stops2 = new Stop[] { new Stop(0.05f, Color.rgb(255, 255, 255, 0.7)), new Stop(0.05f, Color.rgb(255, 255, 255,
0.55)), new Stop(0.5f, Color.rgb(255, 255, 255, 0.1)), new Stop(0.5f, Color.rgb(255, 255, 255, 0.0)), new Stop(0.6f, Color.rgb(
255, 255, 255, 0.0)), new Stop(0.85f, Color.rgb(255, 255, 255, 0.4)), new Stop(1f, Color.rgb(245, 245, 245,
0.7)) };
LinearGradient gradient2 = new LinearGradient(0.0, 0.0, 0.0, 1.0, true, CycleMethod.NO_CYCLE, stops2);
BackgroundFill backkgroudFill2 = new BackgroundFill(gradient2, new CornerRadii(2.0), new Insets(0));
list.add(backkgroudFill2);
getSkinnable().setBackground(new Background(list, null));
}
}