use of com.jfoenix.transitions.JFXKeyValue in project JFoenix by jfoenixadmin.
the class JFXDrawer method addAnimatedKeyValue.
public void addAnimatedKeyValue(Node node, List<JFXDrawerKeyValue<?>> values) {
Collection<JFXKeyValue<?>> modifiedValues = new ArrayList<>();
for (JFXDrawerKeyValue value : values) {
JFXKeyValue modifiedValue = JFXKeyValue.builder().setEndValueSupplier(() -> currentValue.get(value.getTarget()).get()).setAnimateCondition(() -> node.getScene() != null && value.isValid()).setTargetSupplier(() -> value.getTarget()).setInterpolator(value.getInterpolator()).build();
modifiedValues.add(modifiedValue);
currentValue.put(value.getTarget(), isClosed() ? value.getCloseValueSupplier() : value.getOpenValueSupplier());
initValues.put(value.getTarget(), value);
}
animatedValues.addAll(modifiedValues);
final JFXKeyFrame keyFrame = new JFXKeyFrame(duration, modifiedValues.toArray(new JFXKeyValue[0]));
try {
translateTimer.addKeyFrame(keyFrame);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations