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.
IndexProgramming Questions & HelpIntegration › xHTML 1.0 Strict and applet preloading!
Pages: 1 2 
xHTML 1.0 Strict and applet preloading! (Read 6146 times)
xHTML 1.0 Strict and applet preloading!
Jan 15th, 2007, 5:34pm
 
Spend some time testing <applet> vs. <object>: I must say <object> is actually more compatible and reliable than <applet>. My test results and templates for export-to-web are here.

While already working on the xHTMLs i decided to spend some time improving the loading and status display of starting applets. I found a working, gracefully degrading and customizable method. How it works is outlined at the bottom of the text above.

Let me know what you think.
F
Re: xHTML 1.0 Strict and applet preloading!
Reply #1 - Jan 15th, 2007, 7:41pm
 
Excellent work. Looks great and seems to work fine for me. The solution I had come up with did some strange things on Firefox, but yours seems to avoid it. I don't know exactly why, but hell, when it ain't broke...

I see you've kept this insane classid code:

Code:
object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" 



What /is/ that monster?
Re: xHTML 1.0 Strict and applet preloading!
Reply #2 - Jan 15th, 2007, 7:54pm
 
thanks.

it's called dynamic versioning. details are here.

i decided to go for java 1.4.2 as the minimum version since that's the version that introduced the loading-bar and icon .. the current minimum for processing is 1.3 (see here).

what system / java / browsers do you run
did you test the preloader

F
Re: xHTML 1.0 Strict and applet preloading!
Reply #3 - Jan 21st, 2007, 7:35pm
 
Microsoft Windows XP Pro v.2002 SP.2

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9

Java SDK 1.6.0-b.105

MY ****'IN GOD IS WORKS!!! this will rock my new site.

Thoughts: This method is so good that it should be able for everyone to use. However, I will still set a flash viewer to be the default for my users. I will work on java side as well, and allow someone to check off "see java" on their profile.

thank you, processing.
Re: xHTML 1.0 Strict and applet preloading!
Reply #4 - Jan 21st, 2007, 8:17pm
 
So how do I translate:

code, archive, w, h, mayscript

into:

class, archives[], width, height, mayscript, codebase, params[], type

There's only one archive I need to access. Will that not work? The new appletobject_05.js is far too bloody confusing for a simpleton like me, but I reckon I can customise the loadApplet function you've got there easily.

Because of the custom settings on my folio I should be able to allow users to customise the colors of the loading bar easily.

And what's with all the CDATA tags? What does that do exactly?
Re: xHTML 1.0 Strict and applet preloading!
Reply #5 - Jan 21st, 2007, 9:02pm
 
thanks for the flowers taifunflame! let me know when we can see your site in action!

st33d, like this:
var ao = new AppletObject( 'xhtml1', ['candy.jar' ], '100', '100', 'true');

it takes a variable number of arguments .. that's why they are parsed as arguments[] inside appletobject.js.
( if you want to use the improved <object> tag, you will either have to pass that too to your object (as i did in my example-html), or change it inside the .js. look for AppletObjects.TAG_APPLET and change to AppletObjects.TAG_OBJECT)

a commented source for appleobject.js 005 is here.

best,
F
Re: xHTML 1.0 Strict and applet preloading!
Reply #6 - Jan 22nd, 2007, 5:46pm
 
Ahem.

So where are these necessary files? And what do I have to do to appletobject_05.js to make it work?

this.preLoadClass = "de.bezier.js.preloading.Preloading.class";
this.preLoadJar   = "ZZZZZZ.jar";

The AppletObject you suggested didn't work. Instead I tried:

var ao = new AppletObject('snakeAI5', ['http://www.robotacid.com/PBeta/snakeAI5/snakeAI5.jar'  ], '400', '400', 'true', '', [], AppletObjects.TAG_OBJECT);

Which got me loading... but no loading bar and on IE it just crashed. Which was how I found out about the preloading class because the console moaned about it whilst IE refused to shut down.
Re: xHTML 1.0 Strict and applet preloading!
Reply #7 - Jan 22nd, 2007, 6:31pm
 
Okay I figured out where ZZZZZZ.jar was and put on the server. But still no loading bar. I've cleared the cache and still it's refusing to load bar the damned thing. Here's my mod of the test applet:

http://www.robotacid.com/misc/loadbarjar.html
Re: xHTML 1.0 Strict and applet preloading!
Reply #8 - Jan 22nd, 2007, 9:25pm
 
hmm .. might be due to you using full urls. and you don't set a classpath .. lemme check on my server. back in a sec ..

F
Re: xHTML 1.0 Strict and applet preloading!
Reply #9 - Jan 22nd, 2007, 9:33pm
 
ok. full URLs and relative URLs are not allowed with archive. so you have to specify a classpath to these. so, put ZZZZZZ.jar along with your other jars and then specify the classpath in the call, view-source here:

http://bezier.de/processing/xhtml/appletobject/index_test.html

let me know how it goes ..
F
Re: xHTML 1.0 Strict and applet preloading!
Reply #10 - Jan 22nd, 2007, 9:35pm
 
by the way .. just having one jar will not give you much of a progress-bar all together. the bar updates (twice) _per_ jar, so with one jar you will have 50% and 100% ...

you might want to alter the "oninit" callback to be:

ao.oninit = function () {
  ao.onstep(0);
};

and mybe re-export your sketches to use seperate jars (see processings preferences) .. then they could all live in one place and share core.jar, opengl.jar .. you get it.

F
Re: xHTML 1.0 Strict and applet preloading!
Reply #11 - Jan 22nd, 2007, 9:45pm
 
just to keep things tidy:

xhtml-strict templates:
http://dev.processing.org/bugs/show_bug.cgi?id=490

javascript preloading:
http://dev.processing.org/bugs/show_bug.cgi?id=491

F
Re: xHTML 1.0 Strict and applet preloading!
Reply #12 - Jan 22nd, 2007, 10:11pm
 
fjen wrote on Jan 22nd, 2007, 9:33pm:
ok. full URLs and relative URLs are not allowed with archive. so you have to specify a classpath to these. so, put ZZZZZZ.jar along with your other jars and then specify the classpath in the call, view-source here:

http://bezier.de/processing/xhtml/appletobject/index_test.html

let me know how it goes ..
F

What's a classpath in this context Where do I specify it I'm a bit confused because I've already been getting away with full urls for 'archive' for the simple version.

Not having full urls isn't an option for me I think. It would involve a total re-write of the way my folio handles files, and not having relative paths would mean 'frames'. Plus it will never be pulling in more than one .jar (thanks to Flash htmlText).

I hope you're not thinking I'm being difficult. I just happen to be an auto-didactic programmer - I've had unconventional training.

I figured out what the CDATA tags were for though. They're to protect an XML parser from the code in the <script> nodes. Smiley

I may not use this method for my folio, but I would like to get it working myself just to prove to myself I can do it.
Re: xHTML 1.0 Strict and applet preloading!
Reply #13 - Jan 23rd, 2007, 1:02am
 
naahh .. you do fine!

in the old version the <applet> tag was taking full urls .. but with <object> that's not working anymore. just figured that out thanks to your problem. Smiley

look into the source of the html i linked above, the classpath is the '../withoutGL/' thing. it's a relative pointer to where your jars are (directory). so instead of putting a full url infront of every jar, just specify the path once and you're good to go.

in your case: instead of writing:
Code:

var ao = new AppletObject(
'timelapseSmall',
['http://www.robotacid.com/PBeta/timelapseSmall.jar'  ],
'640', '480',
'true',
'',
[],
AppletObjects.TAG_OBJECT);


do:
Code:

var ao = new AppletObject(
'timelapseSmall',
['timelapseSmall.jar'  ],
'640', '480',
'true',
'/PBeta/',
[],
AppletObjects.TAG_OBJECT);


i don't see how that's gonna make things different for your portfolio. should be simpler now since the code is shorter.

lemme know how it works out ..
F
Re: xHTML 1.0 Strict and applet preloading!
Reply #14 - Jan 23rd, 2007, 10:04am
 







Hi Florian

I seem to have missed your Javascript Applet thread. Unfortunately I have been working in parallel on the same topic. I have set up a sourceforge.org account for what I have done so far. Although it seems that you have put a lot more work into this as I have, I would suggest that we merge the two code bases and continue working together on sourceforge so that the whole Java community can benefit from the work and vise versa.

I have included an activeX shell method of Java detection that detects without the "cycle through all versions" hack. It raises a security warning but is useful for Intranet or well trusted sites.

Things that I would like to add...

Connection to a server to help "auto-test" the code. This would log all browser and jre combination that worked and didn't.

A real java detect( with an applet ) for Java versions 1.1 - 1.3.1 on IE that then stores the java version in a cookie or a server side session so that it only has to be run once a session. For example the version checker applet on the processing start page could store the version in the session making java detection for the life of the session unnecessary.

Templates for "{yourdomain} requires at least Java version {version number} update it at {updatesite}", etc...

An iframe version for browsers that do not support Javascript.

Display of error messages if the applet does not load.


My goal for this project is to make it a comfortable as possible to use Java and to increase its pervasiveness.



Servus aus Graz,
Stephen

Pages: 1 2