Git Product home page Git Product logo

trident's Introduction

Notice

Trident is now part of Radiance.

Older Trident releases can be found here. Follow new development and open bugs / feature requests under Radiance.

trident's People

Contributors

kirill-grouchnikov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trident's Issues

NPE in CorePropertyInterpolators

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.

OS dependent behavior for JSplitPane's dividerLocation

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...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.