RFC: Loading animation for applets
Deepak Bhole
dbhole at redhat.com
Wed May 27 12:54:59 PDT 2009
* Omair Majid <omajid at redhat.com> [2009-05-27 15:36]:
> Deepak Bhole wrote:
>> * Omair Majid <omajid at redhat.com> [2009-05-27 13:31]:
>>> Hi,
>>>
>>> The attached patch adds an applet loading animation for IcedTeaPlugin
>>> to icedtea6.
>>>
>>> The patch adds binary files (images). A mercurial bundle is available
>>> from
>>> http://icedtea.classpath.org/~omajid/applet-loading-animation.hg.
>>> (Use hg unbundle to apply it.)
>>>
>>> The main change is adding an animator class to NetxPanel. This
>>> PluginAppetLoadingAnimator shows the animation in the panel until the
>>> applet has initialized. To have the animator stop when the applet
>>> has finished initializing, extra events have been added. All these
>>> events are now sent by AppletPanel instead of NetxPanel since only
>>> AppletPanel knows exactly what the state of the applet it.
>>>
>>
>> I see you are patching AppletPanel. Can't this be done instead by
>> drawing the image in a panel added to the main applet panel via
>> PluginAppletViewer? Changing upstream classes for the plugin should be
>> avoided unless absolutely necessary...
>>
>
> The hook for the image drawing code is through NetxPanel which is not
> part of upstream. The patch to AppletPanel makes the applet emit more
> events to any AppletListener listening. This allows us to find out when
> Applet.init() completes and stop the animation, which matches the
> behaviour of Sun's plugin. Without this patch, the animation would only
> display until init() is called.
>
> I agree about patching upstream classes, but I couldn't see any other
> way to find out when init() has completed (short of adding more code and
> a specialized listener class to AppletPanel). If you still think this is
> a bad idea, let me know, and I will remove it.
>
That is the only time we should be drawing for, should we not? I thought
the Sun plugin drew only while the jars were downloading, and then
delegated to the applet? If the applet has a splash screen that it
displays in its init(), wouldn't this patch override it with our splash?
Deepak
> Cheers,
> Omair
More information about the distro-pkg-dev
mailing list