We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
PApplet "wrap" existing Applet (Read 534 times)
PApplet "wrap" existing Applet
Mar 14th, 2008, 2:17am
 
It would be nice if I could create a new PApplet on top of an existing applet.

Envisioned usage (on a webpage):

1.) class LoadingApplet extends Applet
  - LoadingApplet is very small in size.
  - It loads quickly, and then immediately looks on the server for "core.jar"
  - It makes a new UrlClassLoader and loads all classes in core.jar
  - Then, it makes that classloader load your jar with your processing project.

2.) class MyPapplet extends PApplet
  - reflexively called method "constructOnTop(Applet a)" by the above applet.

The result: No annoying gray box of doom, nor the java sunburst load: the applet loads so quickly it's almost like text. Then, using java applet's relatively acceptable graphics objects, you draw on the applet a primitive loading bar that shows the progress of the processing core.jar being loaded, and when everything's ready, it reflectively calls the PApplet class to come and wrap itself so that further draw calls can now be routed to PApplet.

I hope that wasn't too wordy. I myself haven't looked extensively in the internals of processing, but seeing as how I have had success with dynamically loading libraries (such as Minim.jar after the Papplet loads), and don't see why I could even take this extreme step.
Page Index Toggle Pages: 1