Giter VIP home page Giter VIP logo

Comments (7)

kirill-grouchnikov avatar kirill-grouchnikov commented on May 28, 2024

Is this happening under the latest 0.9.0-dev build of Substance from Radiance? The line numbers do not match the stack trace.

Looking at the CellRepaintCallback in SubstanceListUI, it is marked as UIThreadTimelineCallbackAdapter which means that everything in it should be run on the UI thread by Trident. In this stack trace it should be in Timeline.Chain.handleStateChange where it looks at the callback and its annotations.

If this is still happening under the latest Radiance sources, I would need the matching stack trace and, ideally, a small complete test app that shows this issue.

from radiance.

cmadsen avatar cmadsen commented on May 28, 2024

When I try to build 0.9.0-dev with ./gradlew I get

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

Seems like gradle/wrapper/gradle-wrapper.jar is missing?

from radiance.

kirill-grouchnikov avatar kirill-grouchnikov commented on May 28, 2024

My bad. I'll remove gradle from the .gitignore, but it will take me a few days.

In the meantime, you can get substance, trident and neon jars from drop/0.9-dev/core and add them to the classpath.

https://github.com/kirill-grouchnikov/radiance/tree/master/drop/0.9-dev/core

from radiance.

cmadsen avatar cmadsen commented on May 28, 2024

As far as I can tell from the code if (shouldRunOnUIThread && (Timeline.this.uiToolkitHandler != null)) in Timeline.Chain.handleStateChange:~197 the annotation on UIThreadTimelineCallbackAdapter is ignored if there is no uiToolkitHandler. This happens when the mainTimelineObject given to the Timeline constructor is not a Component.

This happens in In StateTransitionTracker.java:345

		this.transitionTimeline = new Timeline(this);
		this.transitionTimeline.setName("Model transitions");
		this.transitionTimeline.addCallback(this.repaintCallback
				.getRepaintCallback());

where this (StateTransitionTracker) is not a Component.

Timeline.java:197:

if (shouldRunOnUIThread && (Timeline.this.uiToolkitHandler != null)) {
                Timeline.this.uiToolkitHandler.runOnUIThread(mainObject,
                        () -> callback.onTimelineStateChanged(oldState, newState, durationFraction,
                                timelinePosition));
            } else {
                callback.onTimelineStateChanged(oldState, newState, durationFraction,
                        timelinePosition);
            }

So even if this.repaintCallback.getRepaintCallback() is a UIThreadTimelineCallbackAdapter it will get called outside the EDT?

Here is how it looks in my debugger with an older version of Substance, uiToolkitHandler is null and shouldRunOnUIThread is true:

this	Timeline$Chain  (id=540)	
	callbacks	ArrayList<E>  (id=548)	
	this$0	Timeline  (id=556)	
		callback	Timeline$Chain  (id=540)	
		cycleDelay	0	
		doneCount	1	
		duration	200	
		durationFraction	1.0	
		ease	Spline  (id=559)	
		fullObjectID	TimelineEngine$FullObjectID  (id=562)	
		id	36501	
		initialDelay	0	
		isLooping	false	
		mainObject	StateTransitionTracker  (id=564)	
		name	"Model transitions" (id=566)	
		propertiesToInterpolate	ArrayList<E>  (id=567)	
		repeatBehavior	null	
		repeatCount	0	
		secondaryId	null	
		stateStack	Stack<E>  (id=568)	
		timelinePosition	1.0	
		timeUntilPlay	0	
		toCancelAtCycleBreak	false	
		uiToolkitHandler	null	
callback	SubstanceListUI$CellRepaintCallback  (id=539)	
	cellIndex	1898	
	list	BasicComboPopup$1  (id=572)	
	this$0	SubstanceListUI  (id=538)	
		cellHeight	-1	
		cellHeights	(id=658)	
		cellWidth	378	
		columnCount	1	
		focusListener	BasicListUI$Handler  (id=660)	
		handler	BasicListUI$Handler  (id=660)	
		isFileList	false	
		isLeftToRight	true	
		lafWidgets	HashSet<E>  (id=664)	
		layoutOrientation	0	
		list	BasicComboPopup$1  (id=572)	
		listDataListener	BasicListUI$Handler  (id=660)	
		listHeight	0	
		listSelectionListener	BasicListUI$Handler  (id=660)	
		listWidth	0	
		mouseInputListener	BasicListUI$Handler  (id=660)	
		preferredHeight	0	
		propertyChangeListener	BasicListUI$Handler  (id=660)	
		rendererPane	CellRendererPane  (id=668)	
		rolledOverIndex	-1	
		rowsPerColumn	0	
		selectedIndices	HashMap<K,V>  (id=670)	
		stateTransitionMultiTracker	StateTransitionMultiTracker<T>  (id=673)	
		substanceComponentListener	SubstanceListUI$2  (id=675)	
		substanceFadeRolloverListener	SubstanceListUI$RolloverFadeListener  (id=678)	
		substanceListDataListener	SubstanceListUI$SubstanceListDataListener  (id=680)	
shouldRunOnUIThread	true	
clazz	Class<T> (org.pushingpixels.trident.callback.TimelineCallbackAdapter) (id=544)	
i	1	
durationFraction	0.205	
timelinePosition	0.12563747	

from radiance.

kirill-grouchnikov avatar kirill-grouchnikov commented on May 28, 2024

Thanks for tracking that. Can't believe that the bug has been in there for so long.

That timeline should be getting this.component instead of this. It'll take me until early next week to commit it to Git.

from radiance.

cmadsen avatar cmadsen commented on May 28, 2024

No problem, we have been haunted by this for years.

from radiance.

kirill-grouchnikov avatar kirill-grouchnikov commented on May 28, 2024

This introduced broken behavior whereas views tracked by StateTransitionTracker are not properly painted when the first time. Fix coming up this week.

from radiance.

Related Issues (20)

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.