WorldWind学习笔记[二]worldwind 在applet上部署

一、页面上的Applet代码
jogl.jar和gluegen-rt.jar如果读本地的话就是改路径,如果是网络的话就可以默认
附件worldwind_lib包中包函基本jar包和jnlp文件
gluegen.rar和joal.rar中包函了针对不同计算机的jar包。
    对所有的jar包签名
    判断是否已经签名,例如判断worldwind.jar是否被签名jarsigner -verify worldwind.jar
    如果没有签名那就开始签名,详见[ JNLP and Java Web Start 签名文件]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>World wind学习</title>
</head>
<body>
	<!--互联网-->
	<applet id="wwjApplet" mayscript code="org.jdesktop.applet.util.JNLPAppletLauncher" width="600px" height="380px"

          archive="applet-launcher.jar, worldwind.jar, WWJApplet.jar, http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar, http://download.java.net/media/gluegen/webstart/gluegen-rt.jar"> 
       <param name="jnlp_href" value="WWJApplet.jnlp"> 
       <param name="codebase_lookup" value="false"> 
       <param name="subapplet.classname" value="gov.nasa.worldwind.examples.applet.WWJApplet"> 
       <param name="subapplet.displayname" value="WWJ Applet"> 
       <param name="noddraw.check" value="true"> 
       <param name="progressbar" value="true"> 
       <param name="jnlpNumExtensions" value="1"> 
       <param name="jnlpExtension1" value="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp"> 
    </applet> 
	<!--局域网-->
	<!--
    <applet id="wwjApplet" mayscript code="org.jdesktop.applet.util.JNLPAppletLauncher" width="600px" height="380px"        archive="lib/WWJApplet.jar,lib/applet-launcher.jar,lib/worldwind.jar,lib/jogl/jogl.jar,lib/gluegen/gluegen-rt.jar"> 
       本地相对地址
       <param name="jnlp_href" value="lib/WWJApplet.jnlp"> 
       <param name="codebase_lookup" value="false"> 
       <param name="subapplet.classname" value="gov.nasa.worldwind.examples.applet.WWJApplet"> 
       <param name="subapplet.displayname" value="My_Applet"> 
       <param name="noddraw.check" value="true"> 
       <param name="progressbar" value="true"> 
       <param name="jnlpNumExtensions" value="1"> 
       本地相对地址
       <param name="jnlpExtension1" value="lib/jogl/jogl.jnlp"> 
    </applet>
	-->
</body>
</html>

二、WWJApplet.jnlp代码
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id -->
   <jnlp href="WWJApplet.jnlp">
    <information>
        <title>World Wind Java Applet Demo</title>
        <vendor>NASA</vendor>
        <homepage href="http://worldwind.arc.nasa.gov"/>
        <description>World Wind Java Applet Demo</description>
        <description kind="short">World Wind Java Applet Demo</description>
        <offline-allowed/>
    </information>
    <security>
        <all-permissions/>
    </security>
     <resources os="Windows">
       <property name="sun.java2d.noddraw" value="true"/>
     </resources>
     <resources>
        <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+" initial-heap-size="512m"
              max-heap-size="512m"/>
        <property name="sun.java2d.noddraw" value="true"/>
        <jar href="WWJApplet.jar" main="true"/>
        <jar href="worldwind.jar"/>
        <!-- jogl的jnlp本地相对路径 -->
	<!-- <extension name="jogl" href="http://192.168.1.165:8080/zwind/lib/jogl/jogl.jnlp"/> -->
        <extension name="jogl"
                   href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp"/>
     </resources>
     <!-- Width and heigth are overwritten by the surrounding web page -->
     <applet-desc
         name="WWJ Applet"
         main-class="gov.nasa.worldwind.examples.applet.WWJApplet"
         width="800" height="600">
        <param name="separate_jvm" value="true" />
     </applet-desc>
   </jnlp>

三、jogl文件的xml代码
<?xml version="1.0" encoding="utf-8"?>
<!-- jogl.jnlp 所在本地相对路径 -->
<!-- <jnlp codebase="http://192.168.1.163:8080/zwind/lib/jogl/"
      href="jogl.jnlp"> -->
<jnlp codebase="http://download.java.net/media/jogl/builds/archive/jsr-231-1.x-webstart-current/"
      href="jogl.jnlp">
  <information>
    <title>Java Binding to the OpenGL API</title>
    <vendor>Sun Microsystems, Inc.</vendor>
    <homepage href="http://jogl.dev.java.net/"/>
    <description>Java Binding to the OpenGL API - JSR-231 Current Build</description>
    <description kind="short">Java programming language binding to the OpenGL 3D graphics API. (Current build of JSR-231 APIs)</description>
    <offline-allowed/>
  </information>
  <security>
      <all-permissions/>
  </security>
    <resources>
      <jar href="jogl.jar" />
      <!-- jogl扩展gluegen-rt本地相对路径 -->
      <!-- <extension name="gluegen-rt" href="http://192.168.1.163:8080/zwind/lib/gluegen/gluegen-rt.jnlp" />  -->
      <extension name="gluegen-rt" href="http://download.java.net/media/gluegen/webstart/gluegen-rt.jnlp" />
    </resources>
    <resources os="Windows" arch="x86">
      <nativelib href = "jogl-natives-windows-i586.jar" />
    </resources>
    <resources os="Windows" arch="amd64">
      <nativelib href = "jogl-natives-windows-amd64.jar" />
    </resources>
    <resources os="Windows" arch="x86_64">
      <nativelib href = "jogl-natives-windows-amd64.jar" />
    </resources>
    <resources os="SunOS" arch="sparc">
      <nativelib href = "jogl-natives-solaris-sparc.jar" />
    </resources>
    <resources os="SunOS" arch="sparcv9">
      <nativelib href = "jogl-natives-solaris-sparcv9.jar" />
    </resources>
    <resources os="SunOS" arch="x86">
      <nativelib href = "jogl-natives-solaris-i586.jar" />
    </resources>
    <resources os="SunOS" arch="amd64">
      <nativelib href = "jogl-natives-solaris-amd64.jar" />
    </resources>
    <resources os="SunOS" arch="x86_64">
      <nativelib href = "jogl-natives-solaris-amd64.jar" />
    </resources>
    <resources os="Linux" arch="i386">
      <nativelib href = "jogl-natives-linux-i586.jar" />
    </resources>
    <resources os="Linux" arch="x86">
      <nativelib href = "jogl-natives-linux-i586.jar" />
    </resources>
    <resources os="Linux" arch="amd64">
      <nativelib href = "jogl-natives-linux-amd64.jar" />
    </resources>
    <resources os="Linux" arch="x86_64">
      <nativelib href = "jogl-natives-linux-amd64.jar" />
    </resources>
    <resources os="Mac OS X" arch="ppc">
      <nativelib href = "jogl-natives-macosx-ppc.jar" />
    </resources>
    <resources os="Mac OS X" arch="i386">
      <nativelib href = "jogl-natives-macosx-universal.jar" />
    </resources>
    <resources os="Mac OS X" arch="x86_64">
      <nativelib href = "jogl-natives-macosx-universal.jar" />
    </resources>
  <component-desc />
</jnlp>

四、gluegen文件的xml代码
<?xml version="1.0" encoding="utf-8"?>
<!-- gluegen-rt.jnlp 所在本地相对路径 -->
<!-- <jnlp codebase="http://192.168.1.163:8080/zwind/lib/gluegen/"
      href="gluegen-rt.jnlp"> -->
<jnlp codebase="http://download.java.net/media/gluegen/webstart/"
      href="gluegen-rt.jnlp">
  <information>
    <title>GlueGen Runtime</title>
    <vendor>Sun Microsystems, Inc.</vendor>
    <homepage href="http://gluegen.dev.java.net/"/>
    <description>GlueGen Runtime Library</description>
    <description kind="short">Run-time support classes and native code for applications and libraries built using the GlueGen tool.</description>
    <offline-allowed/>
  </information>
  <security>
      <all-permissions/>
  </security>
    <resources>
      <jar href="gluegen-rt.jar" />
    </resources>
    <resources os="Windows" arch="x86">
      <nativelib href = "gluegen-rt-natives-windows-i586.jar" />
    </resources>
    <resources os="Windows" arch="amd64">
      <nativelib href = "gluegen-rt-natives-windows-amd64.jar" />
    </resources>
    <resources os="Windows" arch="x86_64">
      <nativelib href = "gluegen-rt-natives-windows-amd64.jar" />
    </resources>
    <resources os="SunOS" arch="sparc">
      <nativelib href = "gluegen-rt-natives-solaris-sparc.jar" />
    </resources>
    <resources os="SunOS" arch="sparcv9">
      <nativelib href = "gluegen-rt-natives-solaris-sparcv9.jar" />
    </resources>
    <resources os="SunOS" arch="x86">
      <nativelib href = "gluegen-rt-natives-solaris-i586.jar" />
    </resources>
    <resources os="SunOS" arch="amd64">
      <nativelib href = "gluegen-rt-natives-solaris-amd64.jar" />
    </resources>
    <resources os="SunOS" arch="x86_64">
      <nativelib href = "gluegen-rt-natives-solaris-amd64.jar" />
    </resources>
    <resources os="Linux" arch="i386">
      <nativelib href = "gluegen-rt-natives-linux-i586.jar" />
    </resources>
    <resources os="Linux" arch="x86">
      <nativelib href = "gluegen-rt-natives-linux-i586.jar" />
    </resources>
    <resources os="Linux" arch="amd64">
      <nativelib href = "gluegen-rt-natives-linux-amd64.jar" />
    </resources>
    <resources os="Linux" arch="x86_64">
      <nativelib href = "gluegen-rt-natives-linux-amd64.jar" />
    </resources>
    <resources os="Mac OS X" arch="ppc">
      <nativelib href = "gluegen-rt-natives-macosx-ppc.jar" />
    </resources>
    <resources os="Mac OS X" arch="i386">
      <nativelib href = "gluegen-rt-natives-macosx-universal.jar" />
    </resources>
    <resources os="Mac OS X" arch="x86_64">
      <nativelib href = "gluegen-rt-natives-macosx-universal.jar" />
    </resources>
  <component-desc />
</jnlp>

目录结构

WorldWind学习笔记[二]worldwind 在applet上部署_第1张图片




你可能感兴趣的:(java,Web,xml,互联网,sun)