Typhon0 / AnimateFX

A library of +70 ready-to-use animations for JavaFX
Apache License 2.0
451 stars 66 forks source link

Add partial animation "Expand" and "Contract", which can be used together #27

Closed 41zu closed 1 year ago

41zu commented 1 year ago

for example like this:

nodeObj.setOnMouseEntered(e -> new Expand((Node) e.getSource()).play());
nodeObj.setOnMouseExited(e -> new Contract((Node) e.getSource()).play());

it is also posible to set the beginScale and endScale:

nodeObj.setOnMouseEntered(e -> new Expand((Node) e.getSource()).setEndScale(1.2).play());
nodeObj.setOnMouseExited(e -> new Contract((Node) e.getSource()).setBeginScale(1.2).play());

I also created a new sub package "animatefx.animation.partial", but for that to work I had to increase the method visibility of resetNode and initTimeline, which also means that now every class can extend AnimationFX, which is not a bad change in my opinion.

Internally in the classes of Expand and Contract I had to resort to a few workarounds to support the setBeginScale and setEndScale methods, but they are documented in the classes themself.

Typhon0 commented 1 year ago

Thanks !

41zu commented 1 year ago

@Typhon0 thank you for merging :) would it be possible to release a new version on maven?