<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/wb/ (C) Ken Webb Thu May 17 2012 18:40:48 GMT-0400 (EDT)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Deploying Java Applets
Description:
Url: http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html
InternalName:
YoutubeId:
Keywords:
My Notes
--------
This workbook is an example of how to work with Java applets in a Xholon Workbook. The code loads an applet which draws a picture of a house.
How to run the applet ::
Click the Run button above.
Click the Step button in the overlay.
See the Java and XML source code ::
http://www.primordion.com/Xholon/webEdition/HTModL/ganymede/House.java
http://www.primordion.com/Xholon/webEdition/HTModL/ganymede/house.xml
]]></Notes>
<script implName="lang:python:inline:"><![CDATA[
]]></script>
<script implName="lang:javascript:inline:"><![CDATA[
]]></script>
<_-.XholonClass>
<!-- domain objects -->
<PhysicalSystem/>
<House/>
</_-.XholonClass>
<xholonClassDetails>
</xholonClassDetails>
<PhysicalSystem>
<House/>
</PhysicalSystem>
<Blockbehavior implName="lang:python:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:javascript:inline:"><![CDATA[
]]></Blockbehavior>
<Housebehavior implName="lang:webEditionjs:inline:"><![CDATA[
function postConfigure() {
this.xholoncreationservice('requireScript', 'deployJavaAjax.js');
}
function act() {
if (this.application("getTimeStep") == 0) {
var myAppletDiv = $("div#mySVGDiv");
myAppletDiv.empty();
var attributes = {
codebase:'http://www.primordion.com/Xholon/webEdition/HTModL/ganymede/',
code:'House.class',
archive:'House.jar',
width:320,
height:230};
var parameters = {fontSize:16};
var version = '1.6';
deployJava.runApplet(attributes, parameters, version, myAppletDiv);
}
}
]]></Housebehavior>
<Blockbehavior implName="lang:bsh:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:jruby:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:groovy:inline:"><![CDATA[
]]></Blockbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Click the Step button. A Java applet will draw a House.</title>
<rect id="PhysicalSystem/House" fill="#98FB98" height="50" width="50" x="25" y="0"/>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>