[ 
https://issues.apache.org/jira/browse/PIVOT-754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13047202#comment-13047202
 ] 

Piotr Kołaczkowski commented on PIVOT-754:
------------------------------------------

1) To avoid adding displayHost twice - when I wrote it, I wasn't sure in how 
many places it is needed, if I remove it from init. Anyway, feel free to remove 
it and replace by just add(displayHost) if you think it is ok.
2) True, that is why it needs some tweaking. It is not a final solution, it is 
just an example that works for us. You should perhaps consider adding a 
background color as a parameter to the applet.
3) We haven't tried that. Where is the list of possible params documented? 
However, I don't see a purpose for that - why display an image to the user, for 
about 0.3 - 0.5 seconds? Before the applet download, there is a splash screen 
with custom download progress bar and a logo - it is enough. And the clear 
white applet loads and displays insanely fast, so there is no risk of that gray 
thing ever showing.

BTW: There is something messed up with deployment of most of the sample applets 
on the Pivot page. The Java progress bar disappears and displays a gray box not 
for half a second, but for much much longer, until all the jars finish 
downloading. Also you should consider using Proguard and pack200 - the download 
size of the samples is pretty huge. We could get a complete application with 
Scala + Pivot 2.0 + our code down to about 1 MB instead of 13 MB. 

> Pivot displays ugly gray box sometimes before it loads the applet
> -----------------------------------------------------------------
>
>                 Key: PIVOT-754
>                 URL: https://issues.apache.org/jira/browse/PIVOT-754
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0
>         Environment: Observed both on Linux and Windows Vista, Firefox 3.x 
> and Firefox 4.0.1
> Java 6 update 25.
>            Reporter: Piotr Kołaczkowski
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: pivot-graybox.patch
>
>
> When the applet starts, a progress bar is displayed. When the applet finishes 
> downloading, the progress bar disappears, leaving a gray box until the pivot 
> toolkit loads the application. Even for the simpliest application displaying 
> an empty window, pivot requires about 0.3 s to start (on Core2Duo 2.2 GHz), 
> so the gray box effect can be easily seen. The gray box effect does not 
> happen always, but in about half of the cases.
> Below I submit patch we made to the BrowserApplicationContext.java file. 
> Seems like setting the applet's background to white and delaying the 
> add(displayHost) call as late as possible does the trick:
> [code]
> 51a52
> >         private boolean displayHostInstalled = false;
> 151c152,154
> <                 add(displayHost);
> ---
> > 
> >                 // Don't add it now, add it later, to avoid ugly gray box:
> >                 //add(displayHost);
> 160c163,164
> <                 setBackground(null);
> ---
> >                 // Huh? WTF?
> >                 // setBackground(null);
> 191a196
> >                         installDisplayHostIfNeeded();
> 245a251,257
> >         private void installDisplayHostIfNeeded() {
> >             if (!displayHostInstalled) {
> >                 this.add(displayHost);
> >                 displayHostInstalled = true;
> >             }
> >         }
> > 
> 247a260
> >             this.setBackground(Color.white);
> 309a323
> >             installDisplayHostIfNeeded();
> [/code]

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to