Comments (12)
Seems like a good idea. Will look at the problem. Do you encounter any performance problems?
from afterburner.fx.
I have a ListView with some graphical elements for every cell in the list (the list-cell-content is an afterburner.fx module).
In the list there are between 1 und 1.000 cells und I have about 10 of this ListViews.
So the GUI seems to hang on startup for some seconds (about 20 seconds in my case).
from afterburner.fx.
O.k. I will try to implement that, could you please re-test the asynchronous version?
from afterburner.fx.
No problem, I will test the asynchronous version and tell you the result :)
from afterburner.fx.
fxml is loaded asynchronously. Could you please test that? I'm curious about the performance difference.
from afterburner.fx.
Where can I find the changes? The last commit was 6 days ago.
from afterburner.fx.
The changes were pushed to maven central (1.4.2-SNAPSHOT). I will push the code in few minutes as well.
from afterburner.fx.
I've tested the changed version but there seems to be no difference.
I think the problem is that the getLoader() method is still blocking the FXApplication Thread because it's waiting for the Future to return when finished.
A solution may be to immediately return an empty container-node (e.g. a Region [*] ). When the Future has finished loading, the root-node of the FXMLLoader could be added to the children of the empty container-node which has been returned previously.
[*] A Region should be used to bind the size of the loaded content to the parent-node.
from afterburner.fx.
FXMLLoader is loaded within the edt. Does it work for you? I'm thinking about the asynchronous behavior :-)
from afterburner.fx.
It's still blocking the FXApplication Thread when the FXMLView loads the content (I have a simple ProgressBar in my main-view with progress=-1.0 and the bar-animation stops during loading the child-view).
The thing is that Platform.runLater(runnable); blocks the FXApplication Thread as long as the runnable is working.
The runLater only let the FXApplication Thread decide when to start the runnable.
from afterburner.fx.
The constructor invocation should not block. The get-invocation should. Does it work now with invokeLater? (my tests are green).
What about an asynchronous Future getView method? Then you could parallelise the whole process
from afterburner.fx.
So, back from a short vacation...
-> The constructor is not blocking (duration in my testcase: 7 Milliseconds in FXApplication Thread)
-> The getView method blocks (duration in my testcase: 5.070 Milliseconds in FXApplication Thread)
I like the idea of an additional getView method which returns a Future.
I would recommend to return a javafx.concurrent.Task<Parent>
from afterburner.fx.
Related Issues (20)
- Topgun 1.6.3 Release HOT 5
- How to use dagger2 as a dependency injection? HOT 1
- in r1.7.0, why is there a package "topgun" and "lifecycle"
- set different ResourceBundle for different Views HOT 4
- Dependency-Injection for superclasses..... HOT 2
- groovy compatibility
- System.err.println("File: " + name + " not found, attempting with camel case"); HOT 4
- How to navigate between scenes / nested scenes? HOT 1
- Injection context ignored for presenter members at first HOT 3
- afterburner.fx not working with java 9 HOT 3
- FXMLView as custom control for Scene Builder HOT 1
- @Inject can not works in method call of task thread
- Creation before injection
- Provide additional information about injecting fields
- inject ObservableList HOT 1
- [Advice] CSS not loading
- IllegalStateException: while synchronous loading of fxml
- Inject ints? HOT 1
- Leading slash in getResource() HOT 1
- Maven artifact for this project is a shaded jar, which breaks modules HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from afterburner.fx.