Skip to content

Comments

Add a loading screen#629

Merged
JLLeitschuh merged 7 commits intoWPIRoboticsProjects:masterfrom
AustinShalit:loading-screen
Jul 26, 2016
Merged

Add a loading screen#629
JLLeitschuh merged 7 commits intoWPIRoboticsProjects:masterfrom
AustinShalit:loading-screen

Conversation

@AustinShalit
Copy link
Member

@AustinShalit AustinShalit commented Jul 18, 2016

I added a loading screen to GRIP.

@JLLeitschuh Something that will make this nicer is a higher quality version of the GRIP logo.

Video Demo: https://youtu.be/J08DqqBTGPY

@codecov-io
Copy link

codecov-io commented Jul 18, 2016

Current coverage is 57.73% (diff: 0.00%)

Merging #629 into master will decrease coverage by 1.12%

@@             master       #629   diff @@
==========================================
  Files           194        194          
  Lines          6051       6062    +11   
  Methods           0          0          
  Messages          0          0          
  Branches        550        551     +1   
==========================================
- Hits           3562       3500    -62   
- Misses         2327       2398    +71   
- Partials        162        164     +2   

Sunburst

Powered by Codecov. Last update 4a4b71c...307cb09

private Stage preloaderStage;

@Override
public void start(Stage preloaderStage) throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is part of the method signature defined by Preloader.start?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to throw the Exception even if the parent class does. I'd rather see explicitly what methods this method actually throws.
Try removing it and adding only the exceptions that get thrown and see if it still compiles. I bet it will.

@JLLeitschuh
Copy link
Member

I like it!

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.util.Modules;
import com.sun.javafx.application.LauncherImpl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're supposed to avoid this package. Is there another way to do this?? If not it's fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found another way. Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JLLeitschuh Just for future reference, com.sun.* is fine, it's sun.* that should be avoided

@AustinShalit
Copy link
Member Author

Has anyone have experience with loading bars? How do you decide when to add to the completion of the bar?

@JLLeitschuh
Copy link
Member

You'll have to ask @ThomasJClark for a higher quality version of the GRIP logo.
I'll see if I can get one out of him.

@AustinShalit
Copy link
Member Author

If possible a vector drawing.

notifyPreloader(new Preloader.ProgressNotification(0.45));
server.addHandler(pipelineSwitcher);
server.start();
notifyPreloader(new Preloader.ProgressNotification(0.6));
Copy link
Member Author

@AustinShalit AustinShalit Jul 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments on the location of these progress events? Should I add more or have less...

@AustinShalit AustinShalit force-pushed the loading-screen branch 3 times, most recently from dab4552 to 6edca52 Compare July 19, 2016 07:16
@JLLeitschuh
Copy link
Member

progressBar = (ProgressBar) root.getChildrenUnmodifiable().filtered(
p -> p instanceof ProgressBar).get(0);

System.setProperty("prism.lcdtext", "false");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Font smoothing

@JLLeitschuh
Copy link
Member

How does this look on High DPI screens? Any idea?

@AustinShalit
Copy link
Member Author

AustinShalit commented Jul 20, 2016

My guess would be that the loading bar would look taller than it does on a normal display. The image is locked at display width / 4.

Edit: Take a look at this https://youtu.be/VwDD86o8PCQ

@JLLeitschuh
Copy link
Member

Cool! Looks awesome!

new GripSourcesHardwareModule()).with(new GripNetworkModule(), new GripUiModule()));

injector.injectMembers(this);
notifyPreloader(new Preloader.ProgressNotification(0.15));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can guarantee you that creating the dependency injector probably takes the most amount of time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the longest thing for me is starting the Jetty server

@SamCarlberg
Copy link
Member

The loading bar color doesn't fit the theme. Can you change it to more of a forest green that matches the lighter green in the logo?

public void handleApplicationNotification(PreloaderNotification pn) {
if (pn instanceof ProgressNotification) {
progressBar.setProgress(((ProgressNotification) pn).getProgress());
} else if (pn instanceof StateChangeNotification
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instance of!!! Bah! But this is probably the only way.
So, fine, this works.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree... they should change the api

@AustinShalit
Copy link
Member Author

@SamCarlberg For the color are you thinking something like A4CFBE or 58a787?

@SamCarlberg
Copy link
Member

I think something more like 33cc33. Those look too desaturated imo

@AustinShalit
Copy link
Member Author

After discussion on gitter - 6C8058 was picked

@SamCarlberg
Copy link
Member

SamCarlberg commented Jul 21, 2016

Getting this at the end of the stacktrace when I quit the app (it runs fine, though)

:ui:preloader:run FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ui:preloader:run'.
> No main class specified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 43.931 secs
No main class specified
8:55:59 PM: External tasks execution finished 'clean run'.

Edit: only when running from intellij, it's fine when run from the command line.

@SamCarlberg
Copy link
Member

The text is pretty jaggy for me (OS X Yosemite)

@AustinShalit
Copy link
Member Author

AustinShalit commented Jul 21, 2016

@SamCarlberg I fixed the issue with your first comment. You can run the task :ui:preloader:run to test the Preloader. Can you run it in test mode and see if the text is still jaggy?

@JLLeitschuh
Copy link
Member

Is this good to go?

@AustinShalit
Copy link
Member Author

Waiting on a response from @SamCarlberg

@AustinShalit
Copy link
Member Author

@SamCarlberg bump

@SamCarlberg
Copy link
Member

screen shot 2016-07-25 at 3 08 49 pm

@AustinShalit
Copy link
Member Author

@SamCarlberg The latest commit should fix the issue

@JLLeitschuh
Copy link
Member

Good yet?

@AustinShalit
Copy link
Member Author

I think so. @SamCarlberg should probably test it again first

@SamCarlberg
Copy link
Member

Scaling issue is fixed.

@AustinShalit
Copy link
Member Author

LGTM

@JLLeitschuh JLLeitschuh merged commit c05adc1 into WPIRoboticsProjects:master Jul 26, 2016
@AustinShalit AustinShalit deleted the loading-screen branch July 26, 2016 20:28
@AustinShalit AustinShalit added this to the v2.0.0 milestone Jul 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants