Trident is now part of Radiance.
Older Trident releases can be found here. Follow new development and open bugs / feature requests under Radiance.
Java animation library
Hi,
I've added a bounce easing function that you might want to integrate in Trident. The source file is available on my Github fork:
I keep getting a NPE thrown by the CorePropertyInterpolators. So far it is happening intermittently and I haven't found a way to reliably reproduce it, but I figured I would bring it up anyway.
Exception occurred in updating field 'alpha' of object org.jdesktop.jxlayer.JXLayer at timeline position 0.41666666
java.lang.NullPointerException
at org.pushingpixels.trident.interpolator.CorePropertyInterpolators$FloatPropertyInterpolator.interpolate(CorePropertyInterpolators.java:59)
at org.pushingpixels.trident.interpolator.CorePropertyInterpolators$FloatPropertyInterpolator.interpolate(CorePropertyInterpolators.java:50)
at org.pushingpixels.trident.TimelinePropertyBuilder$GenericFieldInfoTo.updateFieldValue(TimelinePropertyBuilder.java:334)
at org.pushingpixels.trident.Timeline$Setter.onTimelineStateChanged(Timeline.java:143)
at org.pushingpixels.trident.Timeline$Chain$1.run(Timeline.java:207)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
I am getting/setting the value with a PropertyAccessor like this:
PropertyAccessor alphaAccessor = new PropertyAccessor() {
@Override
public Float get(Object object, String propertyName) {
return alpha;
}
@Override
public void set(Object object, String propertyName, Float value) {
alpha = value;
layer.repaint(clip);
}
};
The alpha property being modified is a primitive float value being changed from 0.0 to 1.0. This timeline is played forward or backward to fade in or out a BusyPainter painted on a blurred LockableUI over a JXLayer. I have an application that wraps a bunch of panels in these and when they are busy loading data from a server they lock, blur, and fade in a busy painter animation. During application startup I currently have 7 or 8 panels that load their data simultaneously and it so far that seems to be the only time I have seen this occur. I have tried a bit to simulate the work to create a demo of the problem but haven't managed to recreate the issue though.
First let me thank for this superb animation library provided by You. While using it in my software project I found a strange yet funny behavior which I couldn't fix myself. Even after looking through Your sources.
I use the timeline function for animated slides between the two sides of a JSplitPane. This gives the application a little mac os like look and feel.
Anyways, the special thing about those splitpanes is, that you can set the location of the divider by an integer OR by a double.
So the JSplitPane class has a dividerLocation property which is an int but two methods for setting its value.
Now, if you use a Mac or a Windows machine the interpolate mechanism expects to run between two integers. If You use a Linux machine it expects to run between two doubles. Otherwise you will get loads of exceptions.
I created a small os dependent workaround for this problem, but I was hoping that You could find a better way than this. I am not sure if You need more information, or if I should create a small example in order to find the problem more quickly.
Here is a small excerpt of my workaround for it. Surely nothing I am proud of ;-)
public static double showSide(JSplitPane split, double pos, int speedInMillis) {
if (Main.isAnimation()) {
Object start;
Object stop;
if (Tools.isMac() || Tools.isWindows()) {
start = new Integer(split.getDividerLocation());
stop = new Integer(getDividerInAbsolutePosition(split, pos));
} else {
start = new Double(split.getDividerLocation() / getDividerInAbsolutePosition(split, 1.0d));
stop = new Double(pos);
}
final Timeline timeline1 = new Timeline(split);
timeline1.setEase(new Spline(0.9f));
timeline1.addPropertyToInterpolate("dividerLocation", start, stop);
timeline1.setDuration(speedInMillis);
timeline1.play();
} else {
split.setDividerLocation(pos);
}
return pos;
}
If more information is necessary, please feel free to contact me.
Thanks,
Torsten...
The link in the README file points to the BSD 2-clause license when source files show that the BSD 3-clause license is used
The correct link is https://opensource.org/licenses/BSD-3-Clause
I am using Trident in a context where the classloader that loads the jar file is not the same as the thread's classloader that loads the class, which causes the Interpolater to be missing for the float type. I was able to fix this by changing the line to "ClassLoader classLoader = this.getClass().getClassLoader();", but I'm not sure if this is applicable to all cases.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.