
animatefx.animation.ScaleAnimation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AnimateFX Show documentation
Show all versions of AnimateFX Show documentation
A library of ready-to-use animations for JavaFX
The newest version!
package animatefx.animation;
import animatefx.modifier.Modifier;
import animatefx.modifier.ScaleModifier;
import javafx.scene.Node;
/**
* @author Dominik Müka aka 41zu
*/
public abstract class ScaleAnimation extends AnimationFX {
protected Double beginScale;
protected Double endScale;
public ScaleAnimation() { }
public ScaleAnimation(Node node) {
super(node);
}
@Override
public AnimationFX applyAnimationModifier(Modifier modifier) {
if (modifier == null)
throw new NullPointerException("modifier cannot be null");
if (!(modifier instanceof ScaleModifier))
throw new IllegalArgumentException("The modifier instance must be from type ScaleModifier, is: " + modifier.getClass().getName());
// Attributes get checked for null in the initTimeline method
ScaleModifier sm = (ScaleModifier) modifier;
beginScale = sm.getBeginScale().doubleValue();
endScale = sm.getEndScale().doubleValue();
initTimeline();
setAnimationStoppedListener();
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy