[sword-cvs] r6 - in trunk: . app app/WebStart app/src/org/crosswire
app/src/org/crosswire/common app/src/org/crosswire/flashcards
app/src/org/crosswire/modedit
Apache
apache at crosswire.org
Sun Sep 5 11:58:46 MST 2004
Author:
Date: 2004-09-05 11:58:46 -0700 (Sun, 05 Sep 2004)
New Revision: 6
Added:
trunk/.classpath
trunk/.project
trunk/app/WebStart/
trunk/app/WebStart/FlashCards.jnlp
trunk/app/WebStart/jnlp.dtd
trunk/app/WebStart/jnlp.xsd
trunk/app/src/org/crosswire/common/
trunk/app/src/org/crosswire/common/CWClassLoader.java
trunk/app/src/org/crosswire/common/CallContext.java
trunk/app/src/org/crosswire/common/CallContext.jbx
trunk/app/src/org/crosswire/common/ResourceUtil.java
trunk/build.xml
Modified:
trunk/app/Flash.jpx
trunk/app/Flash.jpx.local
trunk/app/src/org/crosswire/flashcards/Editor.java
trunk/app/src/org/crosswire/flashcards/EditorFrame.java
trunk/app/src/org/crosswire/flashcards/EditorFrame_AboutBox.java
trunk/app/src/org/crosswire/flashcards/MainFrame.java
trunk/app/src/org/crosswire/flashcards/MainFrame_AboutBox.java
trunk/app/src/org/crosswire/flashcards/OpenFile.java
trunk/app/src/org/crosswire/flashcards/Quiz.java
trunk/app/src/org/crosswire/modedit/GreekKeymanIM.java
trunk/app/src/org/crosswire/modedit/HebrewDurusauIM.java
trunk/app/src/org/crosswire/modedit/HebrewMCIM.java
trunk/app/src/org/crosswire/modedit/UniTextEdit.java
Log:
Modified program to work w/ Java WebStart
Added: trunk/.classpath
===================================================================
--- trunk/.classpath 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/.classpath 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="app/src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="flashcards.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/.project
===================================================================
--- trunk/.project 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/.project 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>flashcards</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Modified: trunk/app/Flash.jpx
===================================================================
--- trunk/app/Flash.jpx 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/Flash.jpx 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,55 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--JBuilder XML Project-->
-<project>
- <property category="debug.0" name="SmartStepRedefineClasses" value="0"/>
- <property category="debug.0" name="SmartStepSkipStaticInitializers" value="0"/>
- <property category="debug.0" name="SmartStepSkipSynthetics" value="0"/>
- <property category="runtime" name="DefaultConfiguration" value="-1"/>
- <property category="runtime.0" name="BuildTargetOnRun" value="com.borland.jbuilder.build.ProjectBuilder$ProjectBuildAction;make"/>
- <property category="runtime.0" name="ConfigurationName" value="Quiz"/>
- <property category="runtime.0" name="RunnableType" value="com.borland.jbuilder.runtime.ApplicationRunner"/>
- <property category="runtime.0" name="application.class" value="org.crosswire.flashcards.Quiz"/>
- <property category="serverservices" name="single.server.name" value="Tomcat 4.0"/>
- <property category="sys" name="AuthorLabel" value="@author"/>
- <property category="sys" name="BackupPath" value="bak"/>
- <property category="sys" name="CheckStable" value="1"/>
- <property category="sys" name="Company" value=""/>
- <property category="sys" name="CompanyLabel" value="Company:"/>
- <property category="sys" name="Copyright" value="Copyright (c) 2003"/>
- <property category="sys" name="CopyrightLabel" value="Copyright:"/>
- <property category="sys" name="DefaultPath" value="src"/>
- <property category="sys" name="Description" value=""/>
- <property category="sys" name="DescriptionLabel" value="Description:"/>
- <property category="sys" name="DocPath" value="doc"/>
- <property category="sys" name="ExcludeClassEnabled" value="0"/>
- <property category="sys" name="IncludeTestPath" value="1"/>
- <property category="sys" name="InstanceVisibility" value="2"/>
- <property category="sys" name="JDK" value="java version 1.4.2_01-b06"/>
- <property category="sys" name="JvmVersion" value="1.2"/>
- <property category="sys" name="LastTag" value="0"/>
- <property category="sys" name="Libraries" value=""/>
- <property category="sys" name="MakeStable" value="0"/>
- <property category="sys" name="OutPath" value="classes"/>
- <property category="sys" name="SourcePath" value="src;test;../jsword-old/apps/ModEdit/src"/>
- <property category="sys" name="TestPath" value="test"/>
- <property category="sys" name="Title" value=""/>
- <property category="sys" name="TitleLabel" value="Title:"/>
- <property category="sys" name="Version" value="1.0"/>
- <property category="sys" name="VersionLabel" value="@version"/>
- <property category="sys" name="WorkingDirectory" value="."/>
- <property category="sys" name="palette.bean.chooser.beans" value="org.crosswire.modedit.UniTextEdit;"/>
- <node name="Flash" type="Archive">
- <property category="archiving" name="archiverClass" value="com.borland.jbuilder.wizard.archive.ApplicationArchiver"/>
- <property category="archiving" name="contentRules.1" value="I:**/*.*"/>
- <property category="archiving" name="manifestConfigFile" value="0"/>
- <property category="archiving" name="targetPath" value="Flash.jar"/>
- <property category="archiving" name="usingRules" value="1"/>
- </node>
- <node name="FlashEditor" type="Archive">
- <property category="archiving" name="archiverClass" value="com.borland.jbuilder.wizard.archive.ApplicationArchiver"/>
- <property category="archiving" name="contentRules.1" value="I:**/*.*"/>
- <property category="archiving" name="manifestMainClass" value="org.crosswire.flashcards.Editor"/>
- <property category="archiving" name="targetPath" value="FlashEditor.jar"/>
- <property category="archiving" name="usingRules" value="1"/>
- </node>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--JBuilder XML Project-->
+<project>
+ <property category="debug.0" name="SmartStepRedefineClasses" value="0"/>
+ <property category="debug.0" name="SmartStepSkipStaticInitializers" value="0"/>
+ <property category="debug.0" name="SmartStepSkipSynthetics" value="0"/>
+ <property category="personality" name="personality" value=""/>
+ <property category="runtime" name="DefaultConfiguration" value="-1"/>
+ <property category="runtime.0" name="BuildTargetOnRun" value="com.borland.jbuilder.build.ProjectBuilder$ProjectBuildAction;make"/>
+ <property category="runtime.0" name="ConfigurationName" value="Quiz"/>
+ <property category="runtime.0" name="RunnableType" value="com.borland.jbuilder.runtime.ApplicationRunner"/>
+ <property category="runtime.0" name="application.class" value="org.crosswire.flashcards.Quiz"/>
+ <property category="serverservices" name="single.server.name" value="Tomcat 4.0"/>
+ <property category="sys" name="AuthorLabel" value="@author"/>
+ <property category="sys" name="Autorefresh" value="1"/>
+ <property category="sys" name="BackupPath" value="bak"/>
+ <property category="sys" name="CheckStable" value="1"/>
+ <property category="sys" name="Company" value=""/>
+ <property category="sys" name="CompanyLabel" value="Company:"/>
+ <property category="sys" name="Copyright" value="Copyright (c) 2003"/>
+ <property category="sys" name="CopyrightLabel" value="Copyright:"/>
+ <property category="sys" name="DefaultPath" value="src"/>
+ <property category="sys" name="Description" value=""/>
+ <property category="sys" name="DescriptionLabel" value="Description:"/>
+ <property category="sys" name="DocPath" value="doc"/>
+ <property category="sys" name="ExcludeClassEnabled" value="0"/>
+ <property category="sys" name="IncludeTestPath" value="1"/>
+ <property category="sys" name="InstanceVisibility" value="2"/>
+ <property category="sys" name="JDK" value="java version 1.4.2_05-b04"/>
+ <property category="sys" name="JvmVersion" value="1.4"/>
+ <property category="sys" name="LastTag" value="0"/>
+ <property category="sys" name="Libraries" value=""/>
+ <property category="sys" name="MakeStable" value="0"/>
+ <property category="sys" name="OutPath" value="classes"/>
+ <property category="sys" name="SourcePath" value="src;test;../jsword-old/apps/ModEdit/src"/>
+ <property category="sys" name="SourceVersion" value="1.4"/>
+ <property category="sys" name="TestPath" value="test"/>
+ <property category="sys" name="Title" value=""/>
+ <property category="sys" name="TitleLabel" value="Title:"/>
+ <property category="sys" name="Version" value="1.0"/>
+ <property category="sys" name="VersionLabel" value="@version"/>
+ <property category="sys" name="WorkingDirectory" value="."/>
+ <property category="sys" name="palette.bean.chooser.beans" value="org.crosswire.modedit.UniTextEdit;"/>
+ <node name="Flash" type="Archive">
+ <property category="archiving" name="archiverClass" value="com.borland.jbuilder.wizard.archive.ApplicationArchiver"/>
+ <property category="archiving" name="contentRules.1" value="I:**/*.*"/>
+ <property category="archiving" name="manifestConfigFile" value="0"/>
+ <property category="archiving" name="targetPath" value="Flash.jar"/>
+ <property category="archiving" name="usingRules" value="1"/>
+ </node>
+ <node name="FlashEditor" type="Archive">
+ <property category="archiving" name="archiverClass" value="com.borland.jbuilder.wizard.archive.ApplicationArchiver"/>
+ <property category="archiving" name="contentRules.1" value="I:**/*.*"/>
+ <property category="archiving" name="manifestMainClass" value="org.crosswire.flashcards.Editor"/>
+ <property category="archiving" name="targetPath" value="FlashEditor.jar"/>
+ <property category="archiving" name="usingRules" value="1"/>
+ </node>
+ <file path="../build.xml">
+ <property category="ant" name="displayrelativepath" value="0"/>
+ <property category="ant" name="loglevel" value="-debug"/>
+ <property category="ant" name="usebmj" value="0"/>
+ </file>
+</project>
Modified: trunk/app/Flash.jpx.local
===================================================================
--- trunk/app/Flash.jpx.local 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/Flash.jpx.local 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,48 +1,76 @@
-build.menu.1[0]=com.borland.jbuilder.build.ProjectBuilder$ProjectBuildAction;make
-build.menu.2[0]=com.borland.jbuilder.build.ProjectBuilder$ProjectBuildAction;rebuild
-content.layout.xml.[0]=<?xml version="1.0" encoding="UTF-8"?>`n<project-layout>`n <tab_container selected_index="3">`n <tab node_name="src/org/crosswire/flashcards/EditorFrame.java"/>`n <tab node_name="src/org/crosswire/flashcards/EditorFrame_AboutBox.java"/>`n <tab node_name="src/org/crosswire/flashcards/MainFrame_AboutBox.java"/>`n <tab node_name="src/org/crosswire/modedit/UniTextEdit.java"/>`n </tab_container>`n</project-layout>`n
-debug.NoTracingClasses.1[0]=16 java.lang.Object1 1 -1
-debug.NoTracingClasses.2[0]=21 java.lang.ClassLoader1 1 -1
-debug.NoTracingClasses.3[0]=16 java.lang.String1 1 -1
-debug.SplitThreadsAndDataView[0]=0
-history.files.active[0]=src/org/crosswire/modedit/UniTextEdit.java
-history.files.open.1[0]=src/org/crosswire/flashcards/EditorFrame.java,F;86,2593
-history.files.open.2[0]=src/org/crosswire/flashcards/EditorFrame_AboutBox.java,F;46,1366
-history.files.open.3[0]=src/org/crosswire/flashcards/MainFrame_AboutBox.java,F;46,1362
-history.files.open.4[0]=src/org/crosswire/modedit/UniTextEdit.java,F;161,6307
-import.optimize.legacyPropertiesRead[0]=1
-java.classdefaults.1[0]=java.util.Enumeration
-java.classdefaults.2[0]=javax.swing.filechooser.FileFilter
-java.classdefaults.3[0]=java.util.Properties
-java.classdefaults.4[0]=java.util.Hashtable
-java.classdefaults.5[0]=java.util.Set
-packagebrowser.lastClassName[0]=org.crosswire.flashcards.Editor
-sys.Author[0]=
-sys.DefaultPackage[0]=flash
-sys.ReopenHistory.1[0]=src/flash/Quiz.java
-sys.ReopenHistory.10[0]=src/flash/Editor.java
-sys.ReopenHistory.11[0]=src/flash/closeFile.png
-sys.ReopenHistory.12[0]=src/flash/about.png
-sys.ReopenHistory.13[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/java/awt/Font.java
-sys.ReopenHistory.14[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/javax/swing/JFileChooser.java
-sys.ReopenHistory.15[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/javax/swing/text/JTextComponent.java
-sys.ReopenHistory.16[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/java/util/Properties.java
-sys.ReopenHistory.2[0]=src/flash/openFile.png
-sys.ReopenHistory.3[0]=src/flash/OpenFile.java
-sys.ReopenHistory.4[0]=src/flash/MainFrame_AboutBox.java
-sys.ReopenHistory.5[0]=src/flash/MainFrame.java
-sys.ReopenHistory.6[0]=src/flash/help.png
-sys.ReopenHistory.7[0]=Flash.html
-sys.ReopenHistory.8[0]=src/flash/EditorFrame_AboutBox.java
-sys.ReopenHistory.9[0]=src/flash/EditorFrame.java
-wizard.package.package_history.1[0]=flash
-wizards.classes.class_type_history.1[0]=boolean
-wizards.classes.class_type_history.10[0]=java.lang.String
-wizards.classes.class_type_history.2[0]=byte
-wizards.classes.class_type_history.3[0]=char
-wizards.classes.class_type_history.4[0]=short
-wizards.classes.class_type_history.5[0]=int
-wizards.classes.class_type_history.6[0]=long
-wizards.classes.class_type_history.7[0]=float
-wizards.classes.class_type_history.8[0]=double
-wizards.classes.class_type_history.9[0]=java.lang.Object
+build.menu.1[0]=com.borland.jbuilder.build.ProjectBuilder$ProjectBuildAction;make
+build.menu.2[0]=com.borland.jbuilder.build.ProjectBuilder$ProjectBuildAction;rebuild
+classFilter.unittest.1[0]=junit.framework.*
+classFilter.unittest.2[0]=java.lang.reflect.Method
+classFilter.unittest.3[0]=com.borland.jbuilder.unittest.JBTestRunner
+classFilter.unittest.4[0]=sun.reflect.NativeMethodAccessorImpl
+classFilter.unittest.5[0]=sun.reflect.DelegatingMethodAccessorImpl
+content.layout.xml.[0]=<?xml version="1.0" encoding="UTF-8"?>`r`n<project-layout>`r`n <tab_container selected_index="0">`r`n <tab node_name="E%|/Eclipse/JSword/flashcards/build.xml"/>`r`n </tab_container>`r`n</project-layout>`r`n
+debug.NoTracingClasses.1[0]=16 java.lang.Object1 1 -1
+debug.NoTracingClasses.2[0]=21 java.lang.ClassLoader1 1 -1
+debug.NoTracingClasses.3[0]=16 java.lang.String1 1 -1
+debug.SplitThreadsAndDataView[0]=0
+history.files.active[0]=E%|/Eclipse/JSword/flashcards/build.xml
+history.files.open.1[0]=E%|/Eclipse/JSword/flashcards/build.xml,F;101,4761
+import.optimize.legacyPropertiesRead[0]=1
+java.classdefaults.1[0]=java.util.Enumeration
+java.classdefaults.2[0]=javax.swing.filechooser.FileFilter
+java.classdefaults.3[0]=java.util.Properties
+java.classdefaults.4[0]=java.util.Hashtable
+java.classdefaults.5[0]=java.util.Set
+packagebrowser.lastClassName[0]=org.crosswire.flashcards.Editor
+sys.Author[0]=
+sys.DefaultPackage[0]=flash
+sys.ReopenHistory.1[0]=E%|/Eclipse/JSword/flashcards/target/jar/flashcards.jar
+sys.ReopenHistory.10[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter12vocab.flash
+sys.ReopenHistory.11[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter11vocab.flash
+sys.ReopenHistory.12[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter10vocab.flash
+sys.ReopenHistory.13[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter09vocab.flash
+sys.ReopenHistory.14[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter08vocab.flash
+sys.ReopenHistory.15[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter07vocab.flash
+sys.ReopenHistory.16[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter06vocab.flash
+sys.ReopenHistory.17[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter05vocab.flash
+sys.ReopenHistory.18[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter04vocab.flash
+sys.ReopenHistory.19[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter03vocab.flash
+sys.ReopenHistory.2[0]=E%|/Eclipse/JSword/flashcards/lessons/black/eimi_pi.flash
+sys.ReopenHistory.20[0]=Flash.jar
+sys.ReopenHistory.21[0]=src/org/crosswire/modedit/UniTextEdit.java
+sys.ReopenHistory.22[0]=src/org/crosswire/modedit/SWInputMethod.java
+sys.ReopenHistory.23[0]=src/org/crosswire/modedit/NullIM.java
+sys.ReopenHistory.24[0]=src/org/crosswire/flashcards/MainFrame_AboutBox.java
+sys.ReopenHistory.25[0]=src/org/crosswire/flashcards/EditorFrame_AboutBox.java
+sys.ReopenHistory.26[0]=src/org/crosswire/flashcards/EditorFrame.java
+sys.ReopenHistory.27[0]=src/flash/Quiz.java
+sys.ReopenHistory.28[0]=src/flash/openFile.png
+sys.ReopenHistory.29[0]=src/flash/OpenFile.java
+sys.ReopenHistory.3[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter21vocab.flash
+sys.ReopenHistory.30[0]=src/flash/MainFrame_AboutBox.java
+sys.ReopenHistory.31[0]=src/flash/MainFrame.java
+sys.ReopenHistory.32[0]=src/flash/help.png
+sys.ReopenHistory.33[0]=Flash.html
+sys.ReopenHistory.34[0]=src/flash/EditorFrame_AboutBox.java
+sys.ReopenHistory.35[0]=src/flash/EditorFrame.java
+sys.ReopenHistory.36[0]=src/flash/Editor.java
+sys.ReopenHistory.37[0]=src/flash/closeFile.png
+sys.ReopenHistory.38[0]=src/flash/about.png
+sys.ReopenHistory.39[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/java/awt/Font.java
+sys.ReopenHistory.4[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter19vocab.flash
+sys.ReopenHistory.40[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/javax/swing/JFileChooser.java
+sys.ReopenHistory.41[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/javax/swing/text/JTextComponent.java
+sys.ReopenHistory.42[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/java/util/Properties.java
+sys.ReopenHistory.5[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter18vocab.flash
+sys.ReopenHistory.6[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter17vocab.flash
+sys.ReopenHistory.7[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter15vocab.flash
+sys.ReopenHistory.8[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter14vocab.flash
+sys.ReopenHistory.9[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter13vocab.flash
+wizard.package.package_history.1[0]=flash
+wizards.classes.class_type_history.1[0]=boolean
+wizards.classes.class_type_history.10[0]=java.lang.String
+wizards.classes.class_type_history.2[0]=byte
+wizards.classes.class_type_history.3[0]=char
+wizards.classes.class_type_history.4[0]=short
+wizards.classes.class_type_history.5[0]=int
+wizards.classes.class_type_history.6[0]=long
+wizards.classes.class_type_history.7[0]=float
+wizards.classes.class_type_history.8[0]=double
+wizards.classes.class_type_history.9[0]=java.lang.Object
Added: trunk/app/WebStart/FlashCards.jnlp
===================================================================
--- trunk/app/WebStart/FlashCards.jnlp 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/WebStart/FlashCards.jnlp 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 1.0//EN" "jnlp.dtd">
+
+<jnlp spec="1.0+" codebase="http://www.crosswire.org/flashcards/webstart" href="FlashCards.jnlp">
+
+ <information>
+ <title>Flash Card</title>
+ <vendor>Crosswire Bible Society</vendor>
+ <homepage href="http://www.crosswire.org/flashcards"/>
+ <description>Flash Card - A tool for memorizing vocabulary</description>
+ <description kind="short">Flash Card - A tool for learning vocabulary</description>
+ <description kind="tooltip">Flash Cards Memorization Tool</description>
+<!-- Put icons here
+ <icon href="icon32.png"/>
+ <icon kind="splash" href="icon64.png"/>
+-->
+ <offline-allowed/>
+ </information>
+
+ <security>
+ <!--
+ We need disk io to read lessons from disk,
+ and the ability to read system vars.
+ I'm not sure there is much point in asking for less that everything
+ -->
+ <all-permissions/>
+ </security>
+
+ <resources>
+ <j2se version="1.4+"/>
+ <jar href="flashcards.jar"/>
+ <!-- if on the Apple Mac, make it play well -->
+ <property name="apple.laf.useScreenMenuBar" value="true"/>
+ <property name="com.apple.mrj.application.apple.menu.about.name" value="FlashCards"/>
+ </resources>
+
+ <application-desc main-class="org.crosswire.flashcards.Quiz"/>
+
+</jnlp>
Added: trunk/app/WebStart/jnlp.dtd
===================================================================
--- trunk/app/WebStart/jnlp.dtd 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/WebStart/jnlp.dtd 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,158 @@
+
+
+<!ELEMENT jnlp (information+, security?, resources*, (application-desc |
+ applet-desc | component-desc | installer-desc )) >
+
+<!ATTLIST jnlp spec CDATA #IMPLIED>
+
+<!ATTLIST jnlp version CDATA #IMPLIED>
+
+<!ATTLIST jnlp codebase CDATA #IMPLIED>
+
+<!ATTLIST jnlp href CDATA #IMPLIED>
+
+<!ELEMENT information (title?, vendor?, homepage?, description*, icon*,
+ offline-allowed?)>
+
+<!ATTLIST information locale CDATA #IMPLIED>
+
+<!ELEMENT title (#PCDATA)>
+
+<!ELEMENT vendor (#PCDATA)>
+
+<!ELEMENT homepage EMPTY>
+
+<!ATTLIST homepage href CDATA #REQUIRED>
+
+<!ELEMENT description (#PCDATA)>
+
+<!ATTLIST description kind (one-line | short | tooltip ) #IMPLIED>
+
+<!ELEMENT icon EMPTY>
+
+<!ATTLIST icon href CDATA #REQUIRED>
+
+<!ATTLIST icon version CDATA #IMPLIED>
+
+<!ATTLIST icon width CDATA #IMPLIED>
+
+<!ATTLIST icon height CDATA #IMPLIED>
+
+<!ATTLIST icon kind (default | selected | disabled | rollover) "default">
+
+<!ATTLIST icon depth CDATA #IMPLIED>
+
+<!ATTLIST icon size CDATA #IMPLIED>
+
+<!ELEMENT offline-allowed EMPTY>
+
+<!ELEMENT security (all-permissions?, j2ee-application-client-permissions?)>
+
+<!ELEMENT all-permissions EMPTY>
+
+<!ELEMENT j2ee-application-client-permissions EMPTY>
+
+<!ELEMENT resources (j2se | jar | nativelib | extension | property | package)*>
+
+<!ATTLIST resources os CDATA #IMPLIED>
+
+<!ATTLIST resources arch CDATA #IMPLIED>
+
+<!ATTLIST resources locale CDATA #IMPLIED>
+
+<!ELEMENT j2se (resources*)>
+
+<!ATTLIST j2se version CDATA #REQUIRED>
+
+<!ATTLIST j2se href CDATA #IMPLIED>
+
+<!ATTLIST j2se initial-heap-size CDATA #IMPLIED>
+
+<!ATTLIST j2se max-heap-size CDATA #IMPLIED>
+
+<!ELEMENT jar EMPTY>
+
+<!ATTLIST jar href CDATA #REQUIRED>
+
+<!ATTLIST jar version CDATA #IMPLIED>
+
+<!ATTLIST jar main (true|false) "false">
+
+<!ATTLIST jar download (eager|lazy) "eager">
+
+<!ATTLIST jar size CDATA #IMPLIED>
+
+<!ATTLIST jar part CDATA #IMPLIED>
+
+<!ELEMENT nativelib EMPTY>
+
+<!ATTLIST nativelib href CDATA #REQUIRED>
+
+<!ATTLIST nativelib version CDATA #IMPLIED>
+
+<!ATTLIST nativelib download (eager|lazy) "eager">
+
+<!ATTLIST nativelib size CDATA #IMPLIED>
+
+<!ATTLIST nativelib part CDATA #IMPLIED>
+
+<!ELEMENT extension (ext-download*)>
+
+<!ATTLIST extension version CDATA #IMPLIED>
+
+<!ATTLIST extension name CDATA #IMPLIED>
+
+<!ATTLIST extension href CDATA #REQUIRED>
+
+<!ELEMENT ext-download EMPTY>
+
+<!ATTLIST ext-download ext-part CDATA #REQUIRED>
+
+<!ATTLIST ext-download download (lazy|eager) "eager">
+
+<!ATTLIST ext-download part CDATA #IMPLIED>
+
+<!ELEMENT property EMPTY>
+
+<!ATTLIST property name CDATA #REQUIRED>
+
+<!ATTLIST property value CDATA #REQUIRED>
+
+<!ELEMENT package EMPTY>
+
+<!ATTLIST package name CDATA #REQUIRED>
+
+<!ATTLIST package part CDATA #REQUIRED>
+
+<!ATTLIST package recursive (true|false) "false">
+
+<!ELEMENT application-desc (argument*)>
+
+<!ATTLIST application-desc main-class CDATA #IMPLIED>
+
+<!ELEMENT argument (#PCDATA)>
+
+<!ELEMENT applet-desc (param*)>
+
+<!ATTLIST applet-desc documentbase CDATA #IMPLIED>
+
+<!ATTLIST applet-desc main-class CDATA #REQUIRED>
+
+<!ATTLIST applet-desc name CDATA #REQUIRED>
+
+<!ATTLIST applet-desc width CDATA #REQUIRED>
+
+<!ATTLIST applet-desc height CDATA #REQUIRED>
+
+<!ELEMENT param EMPTY>
+
+<!ATTLIST param name CDATA #REQUIRED>
+
+<!ATTLIST param value CDATA #REQUIRED>
+
+<!ELEMENT component-desc EMPTY>
+
+<!ELEMENT installer-desc EMPTY>
+
+<!ATTLIST installer-desc main-class CDATA #IMPLIED>
+
Added: trunk/app/WebStart/jnlp.xsd
===================================================================
--- trunk/app/WebStart/jnlp.xsd 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/WebStart/jnlp.xsd 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,218 @@
+<?xml version="1.0"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:element name="jnlp" type="jnlpType"/>
+
+ <xsd:complexType name="jnlpType">
+ <xsd:sequence>
+ <xsd:element name="information" type="informationType" maxOccurs="unbounded"/>
+ <xsd:element name="security" type="securityType" minOccurs="0"/>
+ <xsd:element name="resources" type="resourcesType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:choice>
+ <xsd:element name="application-desc" type="applicationDescType"/>
+ <xsd:element name="applet-desc" type="appletDescType"/>
+ <xsd:element name="component-desc" type="xsd:string"/>
+ <xsd:element name="installer-desc" type="installerDescType"/>
+ </xsd:choice>
+ </xsd:sequence>
+
+ <xsd:attribute name="spec" type="xsd:string" use="optional"/>
+ <xsd:attribute name="version" type="xsd:string" use="optional"/>
+ <xsd:attribute name="codebase" type="xsd:anyURI" use="optional"/>
+ <xsd:attribute name="href" type="xsd:string" use="optional"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="informationType">
+ <xsd:sequence>
+ <xsd:element name="title" type="xsd:string" minOccurs="0"/>
+ <xsd:element name="vendor" type="xsd:string" minOccurs="0"/>
+ <xsd:element name="homepage" type="homepageType" minOccurs="0"/>
+ <xsd:element name="description" type="descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="icon" type="iconType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="offline-allowed" type="xsd:string" minOccurs="0"/>
+ </xsd:sequence>
+
+ <xsd:attribute name="locale" type="xsd:string" use="optional"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="homepageType">
+ <xsd:attribute name="href" type="xsd:anyURI" use="required"/>
+ </xsd:complexType>
+
+ <xsd:simpleType name="descriptionKindType">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="one-line"/>
+ <xsd:enumeration value="short"/>
+ <xsd:enumeration value="tooltip"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="descriptionType">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="kind" type="descriptionKindType" use="optional"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:simpleType name="iconKindType">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="default"/>
+ <xsd:enumeration value="selected"/>
+ <xsd:enumeration value="disabled"/>
+ <xsd:enumeration value="rollover"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="iconType">
+ <xsd:attribute name="href" type="xsd:anyURI" use="required"/>
+ <xsd:attribute name="version" type="xsd:string" use="optional"/>
+ <xsd:attribute name="width" type="xsd:positiveInteger" use="optional"/>
+ <xsd:attribute name="height" type="xsd:positiveInteger" use="optional"/>
+ <xsd:attribute name="kind" type="iconKindType" use="optional"/>
+ <xsd:attribute name="depth" type="xsd:positiveInteger" use="optional"/>
+ <xsd:attribute name="size" type="xsd:positiveInteger" use="optional"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="securityType">
+ <xsd:sequence>
+ <xsd:element name="all-permissions" type="xsd:string" minOccurs="0"/>
+ <xsd:element name="j2ee-application-client-permissions" type="xsd:string" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="resourcesType">
+ <xsd:sequence>
+ <xsd:element name="j2se" type="j2seType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="jar" type="jarType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="nativelib" type="nativelibType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="extension" type="extensionType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="package" type="packageType" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+
+ <xsd:attribute name="os" type="xsd:string" use="optional" />
+ <xsd:attribute name="arch" type="xsd:string" use="optional" />
+ <xsd:attribute name="locale" type="xsd:string" use="optional" />
+
+ </xsd:complexType>
+
+ <xsd:complexType name="j2seType">
+ <xsd:sequence>
+ <xsd:element name="resources" type="resourcesType" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+
+ <xsd:attribute name="version" type="xsd:string" use="required" />
+ <xsd:attribute name="href" type="xsd:anyURI" use="optional" />
+ <xsd:attribute name="initial-heap-size" type="xsd:string" use="optional" />
+ <xsd:attribute name="max-heap-size" type="xsd:string" use="optional" />
+
+ </xsd:complexType>
+
+ <xsd:simpleType name="booleanType">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="true"/>
+ <xsd:enumeration value="false"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="downloadType">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="eager"/>
+ <xsd:enumeration value="lazy"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="jarType">
+
+ <xsd:attribute name="href" type="xsd:anyURI" use="required" />
+ <xsd:attribute name="version" type="xsd:string" use="optional" />
+ <xsd:attribute name="main" type="booleanType" use="optional" />
+ <xsd:attribute name="download" type="downloadType" use="optional" />
+ <xsd:attribute name="size" type="xsd:string" use="optional" />
+ <xsd:attribute name="part" type="xsd:string" use="optional" />
+
+ </xsd:complexType>
+
+ <xsd:complexType name="nativelibType">
+
+ <xsd:attribute name="href" type="xsd:anyURI" use="required" />
+ <xsd:attribute name="version" type="xsd:string" use="optional" />
+ <xsd:attribute name="download" type="downloadType" use="optional" />
+ <xsd:attribute name="size" type="xsd:string" use="optional" />
+ <xsd:attribute name="part" type="xsd:string" use="optional" />
+
+ </xsd:complexType>
+
+ <xsd:complexType name="extensionType">
+ <xsd:sequence>
+ <xsd:element name="ext-download" type="extDownloadType" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+
+ <xsd:attribute name="version" type="xsd:string" use="optional" />
+ <xsd:attribute name="name" type="xsd:string" use="optional" />
+ <xsd:attribute name="href" type="xsd:anyURI" use="required" />
+
+ </xsd:complexType>
+
+ <xsd:complexType name="extDownloadType">
+
+ <xsd:attribute name="ext-part" type="xsd:string" use="required" />
+ <xsd:attribute name="download" type="downloadType" use="optional" />
+ <xsd:attribute name="part" type="xsd:string" use="optional" />
+
+ </xsd:complexType>
+
+ <xsd:complexType name="propertyType">
+
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="value" type="xsd:string" use="required" />
+
+ </xsd:complexType>
+
+
+ <xsd:complexType name="packageType">
+
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="part" type="xsd:string" use="required" />
+ <xsd:attribute name="recursive" type="booleanType" use="optional" />
+
+ </xsd:complexType>
+
+ <xsd:complexType name="applicationDescType">
+ <xsd:sequence>
+ <xsd:element name="argument" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+
+ <xsd:attribute name="main-class" type="xsd:string" use="optional" />
+
+ </xsd:complexType>
+
+ <xsd:complexType name="appletDescType">
+ <xsd:sequence>
+ <xsd:element name="param" type="paramType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+
+ <xsd:attribute name="documentbase" type="xsd:anyURI" use="optional" />
+ <xsd:attribute name="main-class" type="xsd:string" use="required" />
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="width" type="xsd:positiveInteger" use="required" />
+ <xsd:attribute name="height" type="xsd:positiveInteger" use="required" />
+
+ </xsd:complexType>
+
+ <xsd:complexType name="paramType">
+
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="value" type="xsd:string" use="required" />
+
+ </xsd:complexType>
+
+ <xsd:complexType name="installerDescType">
+
+ <xsd:attribute name="main-class" type="xsd:string" use="optional" />
+
+ </xsd:complexType>
+
+</xsd:schema>
\ No newline at end of file
Added: trunk/app/src/org/crosswire/common/CWClassLoader.java
===================================================================
--- trunk/app/src/org/crosswire/common/CWClassLoader.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/common/CWClassLoader.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,360 @@
+package org.crosswire.common;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * CWClassLoader extends the regular class loader by using looking
+ * in more places. This is needed so that ResourceBundle can find
+ * resources that are not held in the same package as the class.
+ *
+ * <p><table border='1' cellPadding='3' cellSpacing='0'>
+ * <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
+ *
+ * Distribution Licence:<br />
+ * JSword is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public License,
+ * version 2 as published by the Free Software Foundation.<br />
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.<br />
+ * The License is available on the internet
+ * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA<br />
+ * The copyright to this program is held by it's authors.
+ * </font></td></tr></table>
+ * @see gnu.gpl.Licence
+ * @author DM Smith [dmsmith555 at yahoo dot com]
+ * @version $Id: CWClassLoader.java,v 1.4 2004/08/16 22:07:35 joe Exp $
+ */
+public class CWClassLoader extends ClassLoader
+{
+ /**
+ * Creates a class loader that finds resources
+ * for the supplied class that may not be in the class' package.
+ * You can use this within base classes by passing getClass()
+ * to load resources for a derived class.
+ * @param resourceOwner is the owner of the resource
+ */
+ public CWClassLoader(Class resourceOwner)
+ {
+ owner = resourceOwner;
+ }
+
+ /**
+ * Creates a class loader that finds resources
+ * for the calling class that may not be in the class' package.
+ * Use this only within classes that are directly looking up their resources.
+ */
+ public CWClassLoader()
+ {
+ owner = CallContext.instance().getCallingClass();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.ClassLoader#findResource(java.lang.String)
+ */
+ public URL findResource(String search)
+ {
+ URL resource = null;
+ if (search == null || search.length() == 0)
+ {
+ return resource;
+ }
+
+ // First look for it with an absolute path
+ // This allows developer overrides
+ if (search.charAt(0) != '/')
+ {
+ resource = findResource('/' + search);
+ }
+
+ if (resource == null)
+ {
+ // Look for it in the class's package.
+ String newsearch = adjustPackageSearch(search);
+ if (!search.equals(newsearch))
+ {
+ resource = findResource(newsearch);
+ }
+ }
+
+ // Sometimes it comes in with '/' inside of it.
+ // So look for it as a file with '.' in the name
+ // This is the form that will find files in the resource.jar
+ if (resource == null)
+ {
+ // Look for it in the class's package.
+ String newsearch = adjustPathSearch(search);
+ if (!search.equals(newsearch))
+ {
+ resource = findResource(newsearch);
+ }
+ }
+
+ // See if it can be found in the home directory
+ if (resource == null)
+ {
+ resource = CWClassLoader.findHomeResource(search);
+ }
+
+ // See if it can be found by its own class.
+ if (resource == null)
+ {
+ resource = owner.getResource(search);
+ }
+
+ // Try the appropriate class loader
+ if (resource == null)
+ {
+ resource = getClassLoader().getResource(search);
+ }
+
+ // Try the bootstrap and the system loader
+ if (resource == null)
+ {
+ resource = ClassLoader.getSystemResource(search);
+ }
+
+ // For good measure let the super class try to find it.
+ if (resource == null)
+ {
+ resource = super.findResource(search);
+ }
+
+ return resource;
+ }
+
+ /**
+ * Prefix the search with a package prefix, if not already.
+ * Skip a leading '/' if present.
+ */
+ private String adjustPackageSearch(String search)
+ {
+ // If it has embedded '/' there is nothing to do.
+ if (search.indexOf('/', 1) == -1)
+ {
+ String className = owner.getName();
+ String pkgPrefix = className.substring(0, className.lastIndexOf('.') + 1);
+
+ if (search.charAt(0) == '/')
+ {
+ String part = search.substring(1);
+ if (!part.startsWith(pkgPrefix))
+ {
+ search = '/' + pkgPrefix + part;
+ }
+ }
+ else
+ {
+ if (!search.startsWith(pkgPrefix))
+ {
+ search = pkgPrefix + search;
+ }
+ }
+ }
+
+ return search;
+ }
+
+ /**
+ * Change all but a leading '/' to '.'
+ */
+ private String adjustPathSearch(String search)
+ {
+ if (search.indexOf('/', 1) != -1)
+ {
+ // Change all but a leading '/' to '.'
+ if (search.charAt(0) == '/')
+ {
+ search = '/' + search.substring(1).replace('/', '.');
+ }
+ else
+ {
+ search = search.replace('/', '.');
+ }
+ }
+ return search;
+ }
+
+ /**
+ *
+ */
+ public ClassLoader getClassLoader()
+ {
+ // Choose the child loader as it will use the parent if need be
+ // If they are not related then choose the context loader
+ ClassLoader loader = pickLoader(Thread.currentThread().getContextClassLoader(), owner.getClassLoader());
+ return pickLoader(loader, ClassLoader.getSystemClassLoader());
+ }
+
+ /**
+ * Returns 'true' if 'loader2' is a delegation child of 'loader1' [or if
+ * 'loader1'=='loader2']. Of course, this works only for classloaders that
+ * set their parent pointers correctly. 'null' is interpreted as the
+ * primordial loader [i.e., everybody's parent].
+ */
+ private static ClassLoader pickLoader(final ClassLoader loader1, final ClassLoader loader2)
+ {
+ ClassLoader loader = loader2;
+ if (loader1 != loader2)
+ {
+ loader = loader1;
+ if (loader1 == null)
+ {
+ loader = loader2;
+ }
+ else
+ {
+ // Is loader2 a descendant of loader1?
+ // It is if we can walk up to the top and find it.
+ for (ClassLoader curloader = loader2; curloader != null; curloader = curloader.getParent())
+ {
+ if (curloader == loader1)
+ {
+ loader = loader2;
+ break;
+ }
+ }
+ }
+ }
+ return loader;
+ }
+
+ /**
+ * If the application has set the home, it will return
+ * the application's home directory, otherwise it returns null.
+ * @return Returns the home.
+ */
+ public static synchronized URL getHome()
+ {
+ try
+ {
+ if (home != null)
+ {
+ return new URL(home.getProtocol(), home.getHost(), home.getPort(), home.getFile());
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ assert false;
+ }
+ return home;
+ }
+
+ /**
+ * Establish the applications home directory from where
+ * additional resources can be found. URL is expected to
+ * end with the directory name, not '/'.
+ * @param newhome The home to set.
+ */
+ public static synchronized void setHome(URL newhome)
+ {
+ home = newhome;
+ }
+
+ /**
+ * Look for the resource in the home directory
+ * @param search must be non-null, non-empty
+ */
+ public static URL findHomeResource(String search)
+ {
+ URL reply = null;
+
+ URL homeURL = getHome();;
+
+ // Look at the application's home first to allow overrides
+ if (homeURL != null)
+ {
+ // Since home does not end in a '/'
+ // we need to add one to the front of search
+ // if it does not have it.
+ String ssearch = null;
+ if (search.charAt(0) == '/')
+ {
+ ssearch = search;
+ }
+ else
+ {
+ ssearch = '/' + search;
+ }
+
+ URL override = lengthenURL(homeURL, ssearch);
+
+ // Make sure the file exists and can be read
+ File f = new File(override.getFile());
+ if (f.canRead())
+ {
+ reply = override;
+ }
+ }
+
+ return reply;
+ }
+
+ /**
+ * Utility to add a string to the end of a URL.
+ * @param orig The URL to strip
+ * @param extra The text to add to the end of the URL
+ * @return The stripped URL
+ */
+ public static URL lengthenURL(URL orig, String extra)
+ {
+ try
+ {
+ if (orig.getProtocol().equals(PROTOCOL_FILE))
+ {
+ if (orig.toExternalForm().endsWith(File.separator))
+ {
+ return new URL(orig.getProtocol(),
+ orig.getHost(),
+ orig.getPort(),
+ orig.getFile() + extra);
+ }
+ else
+ {
+ return new URL(orig.getProtocol(),
+ orig.getHost(),
+ orig.getPort(),
+ orig.getFile() + File.separator + extra);
+ }
+ }
+ else
+ {
+ return new URL(orig.getProtocol(),
+ orig.getHost(),
+ orig.getPort(),
+ orig.getFile() + SEPARATOR + extra);
+ }
+ }
+ catch (MalformedURLException ex)
+ {
+ assert false : ex;
+ return null;
+ }
+ }
+
+
+ /**
+ * Constant for the file: protocol
+ */
+ public static final String PROTOCOL_FILE = "file"; //$NON-NLS-1$
+
+ /**
+ * URL separator
+ */
+ public static final String SEPARATOR = "/"; //$NON-NLS-1$
+
+ /**
+ * The class to which the resources belong
+ */
+ private Class owner;
+
+ /**
+ * Notion of a project's home from where additional resources can be found.
+ */
+ private static URL home = null;
+}
Added: trunk/app/src/org/crosswire/common/CallContext.java
===================================================================
--- trunk/app/src/org/crosswire/common/CallContext.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/common/CallContext.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,91 @@
+package org.crosswire.common;
+
+/**
+ * This singleton class provides a way for a method to determine
+ * which class called it.
+ * <p>
+ * It has been tested to work in command line and WebStart environments.
+ *
+ * <p><table border='1' cellPadding='3' cellSpacing='0'>
+ * <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
+ *
+ * Distribution Licence:<br />
+ * JSword is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public License,
+ * version 2 as published by the Free Software Foundation.<br />
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.<br />
+ * The License is available on the internet
+ * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA<br />
+ * The copyright to this program is held by it's authors.
+ * </font></td></tr></table>
+ * @see gnu.gpl.Licence
+ * @author DM Smith [ dmsmith555 at yahoo dot com]
+ * @version $Id: CallContext.java,v 1.1 2004/04/20 21:16:06 joe Exp $
+ */
+public class CallContext extends SecurityManager
+{
+ /**
+ * Prevent instansiation
+ */
+ private CallContext()
+ {
+ }
+
+ /**
+ * Singleton accessor
+ */
+ public static CallContext instance()
+ {
+ if (resolver == null)
+ {
+ resolver = new CallContext();
+ }
+
+ return resolver;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.lang.SecurityManager#getClassContext()
+ */
+ protected Class[] getClassContext()
+ {
+ return super.getClassContext();
+ }
+
+ /**
+ * When called from a method it will return the class
+ * calling that method.
+ */
+ public Class getCallingClass()
+ {
+ return getCallingClass(1); // add 1 for this method
+ }
+
+ /**
+ * When called from a method it will return the i-th class
+ * calling that method, up the call chain.
+ * If used with a -1 it will return the class making the call
+ * -2 and -3 will return this class
+ * @throws ArrayIndexOutOfBoundsException if the index is not valid
+ */
+ public Class getCallingClass(int i)
+ {
+ return resolver.getClassContext()[CALL_CONTEXT_OFFSET + i];
+ }
+
+ // may need to change if this class is redesigned
+ /**
+ * Offset needed to represent the caller of the method
+ * that called this method.
+ *
+ */
+ private static final int CALL_CONTEXT_OFFSET = 3;
+
+ private static CallContext resolver;
+}
Added: trunk/app/src/org/crosswire/common/CallContext.jbx
===================================================================
--- trunk/app/src/org/crosswire/common/CallContext.jbx 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/common/CallContext.jbx 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,8 @@
+[PropertyInfo]
+callingClass,Class,false,false, , ,true,<default>
+resolver,CallContext,false,false, , ,false,<default>
+[IconNames]
+
+
+
+
Added: trunk/app/src/org/crosswire/common/ResourceUtil.java
===================================================================
--- trunk/app/src/org/crosswire/common/ResourceUtil.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/common/ResourceUtil.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,71 @@
+package org.crosswire.common;
+
+import java.net.URL;
+import java.util.MissingResourceException;
+
+/**
+ * Better implemenetations of the getResource methods with less ambiguity and
+ * that are less dependent on the specific classloader situation.
+ *
+ * <p><table border='1' cellPadding='3' cellSpacing='0'>
+ * <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
+ *
+ * Distribution Licence:<br />
+ * JSword is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public License,
+ * version 2 as published by the Free Software Foundation.<br />
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.<br />
+ * The License is available on the internet
+ * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA<br />
+ * The copyright to this program is held by it's authors.
+ * </font></td></tr></table>
+ * @see gnu.gpl.Licence
+ * @author Joe Walker [joe at eireneh dot com]
+ * @author DM Smith [ dmsmith555 at yahoo dot com ]
+ * @version $Id: ResourceUtil.java,v 1.5 2004/08/16 22:07:35 joe Exp $
+ */
+public class ResourceUtil
+{
+ /**
+ * Prevent Instansiation
+ */
+ private ResourceUtil()
+ {
+ }
+
+ /**
+ * Generic resource URL fetcher. One way or the other we'll find it!
+ * Either as a relative or an absolute reference.
+ * @param search The name of the resource (without a leading /) to find
+ * @return The requested resource
+ * @throws MissingResourceException if the resource can not be found
+ */
+ public static URL getResource(String search) throws MissingResourceException
+ {
+ return getResource(CallContext.instance().getCallingClass(), search);
+ }
+
+ /**
+ * Generic resource URL fetcher. One way or the other we'll find it!
+ * Either as a relative or an absolute reference.
+ * @param clazz The resource to find
+ * @return The requested resource
+ * @throws MissingResourceException if the resource can not be found
+ */
+ public static URL getResource(Class clazz, String resourceName) throws MissingResourceException
+ {
+ URL resource = new CWClassLoader(clazz).findResource(resourceName);
+
+ if (resource == null)
+ {
+ throw new MissingResourceException("Can't find resource", clazz.getName(), resourceName);
+ }
+
+ return resource;
+ }
+}
Modified: trunk/app/src/org/crosswire/flashcards/Editor.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/Editor.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/flashcards/Editor.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,7 +1,9 @@
package org.crosswire.flashcards;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+
import javax.swing.UIManager;
-import java.awt.*;
/**
* <p>Title: </p>
Modified: trunk/app/src/org/crosswire/flashcards/EditorFrame.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/EditorFrame.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/flashcards/EditorFrame.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,19 +1,36 @@
package org.crosswire.flashcards;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
+import java.awt.AWTEvent;
+import java.awt.BorderLayout;
+import java.awt.ComponentOrientation;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridLayout;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.awt.event.WindowEvent;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
import java.util.Properties;
import java.util.Vector;
-import java.beans.*;
-import javax.swing.event.*;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.Enumeration;
-import java.io.*;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextField;
+import javax.swing.JToolBar;
+import javax.swing.event.CaretEvent;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.filechooser.FileFilter;
+
import org.crosswire.modedit.UniTextEdit;
/**
@@ -204,13 +221,13 @@
////////////////////////////////////////////
//
- private void loadLesson( String fileName ) {
+ private void loadLesson( String lessonFileName ) {
lesson = new Properties( );
try {
- lesson.load( new FileInputStream( fileName ) );
+ lesson.load( new FileInputStream( lessonFileName ) );
} catch( Exception e ) {
@@ -313,7 +330,7 @@
public String getDescription() { return "Flash Card Lessons"; }
});
dialog.setCurrentDirectory(new File("./"));
- if (dialog.showOpenDialog(this) == dialog.APPROVE_OPTION) {
+ if (dialog.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
try {
loadLesson(dialog.getSelectedFile().getCanonicalPath());
} catch( IOException ioe ) {
@@ -337,7 +354,7 @@
public String getDescription() { return "TrueType Font"; }
});
dialog.setCurrentDirectory(new File("./"));
- if (dialog.showOpenDialog(this) == dialog.APPROVE_OPTION) {
+ if (dialog.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
lesson.setProperty("font", dialog.getSelectedFile().getName());
fontPath.setText(lesson.getProperty("font"));
try {
Modified: trunk/app/src/org/crosswire/flashcards/EditorFrame_AboutBox.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/EditorFrame_AboutBox.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/flashcards/EditorFrame_AboutBox.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,10 +1,21 @@
package org.crosswire.flashcards;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.border.*;
+import java.awt.AWTEvent;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import javax.swing.BorderFactory;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
/**
* <p>Title: </p>
* <p>Description: </p>
Modified: trunk/app/src/org/crosswire/flashcards/MainFrame.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/MainFrame.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/flashcards/MainFrame.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,17 +1,53 @@
package org.crosswire.flashcards;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.filechooser.FileFilter;
+import java.awt.AWTEvent;
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.GridLayout;
+import java.awt.SystemColor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.WindowEvent;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.JarURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
import java.util.Vector;
-import java.util.Properties;
-import java.io.FileInputStream;
-import java.util.Hashtable;
-import java.io.*;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import javax.swing.SwingConstants;
+
+import org.crosswire.common.CWClassLoader;
+import org.crosswire.common.ResourceUtil;
+
/**
* <p>Title: </p>
* <p>Description: </p>
@@ -57,6 +93,10 @@
JPanel jPanel3 = new JPanel();
BorderLayout borderLayout7 = new BorderLayout();
JLabel wCount = new JLabel();
+ Map lessonSets = new LinkedHashMap();
+ private static final String LESSON_ROOT = "lessons";
+ private static final String DIR_PROJECT = ".flashcards";
+ private static final String FILE_PROTOCOL = "file";
static class WordEntry {
public WordEntry(String word) { this.word = word; }
@@ -70,16 +110,30 @@
}
- //Construct the frame
- public MainFrame() {
- enableEvents(AWTEvent.WINDOW_EVENT_MASK);
- try {
- jbInit();
+ //Construct the frame
+ public MainFrame()
+ {
+ try
+ {
+ String path = System.getProperty("user.home") + File.separator + DIR_PROJECT; //$NON-NLS-1$
+ URL home = new URL(FILE_PROTOCOL, null, path);
+ CWClassLoader.setHome(home);
+ }
+ catch (MalformedURLException e1)
+ {
+ assert false;
+ }
+
+ enableEvents(AWTEvent.WINDOW_EVENT_MASK);
+ try
+ {
+ jbInit();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
}
- catch(Exception e) {
- e.printStackTrace();
- }
- }
//Component initialization
private void jbInit() throws Exception {
contentPane = (JPanel) this.getContentPane();
@@ -140,7 +194,7 @@
jPanel1.add(jButton3, BorderLayout.EAST);
- loadLessonDirectory("./");
+ loadLessons(LESSON_ROOT);
jTabbedPane1.setSelectedComponent(setupPanel);
}
@@ -159,37 +213,180 @@
while (c.getComponentCount() > 0)
c.remove(c.getComponent(0));
}
- public void loadLessonDirectory(String directoryPath) {
- deleteChildren(lessonPanel);
- File d = new File(directoryPath);
- File[] children = d.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return (name.endsWith(".flash"));
+
+ public void loadLessons(String directoryPath) {
+ deleteChildren(lessonPanel);
+ lessonSets.clear();
+ loadJarLessons(directoryPath);
+ loadHomeLessons(directoryPath);
+ loadWidgets();
+ }
+
+ private void loadJarLessons(String directoryPath)
+ {
+ // Dig into the jar for lessons
+ URL lessonsURL = this.getClass().getResource('/' + directoryPath);
+ URLConnection connection = null;
+ try
+ {
+ connection = lessonsURL.openConnection();
}
- });
- java.util.Arrays.sort(children);
- lessons = new Hashtable();
- for (int i = 0; i < children.length; i++) {
- Properties p = new Properties();
- try {
- p.load(new FileInputStream(children[i].getAbsolutePath()));
+ catch (IOException e1)
+ {
+ assert false;
}
- catch (IOException ex) {
+ if (connection instanceof JarURLConnection)
+ {
+ JarURLConnection jarConnection = (JarURLConnection) connection;
+ JarFile jarFile = null;
+ try
+ {
+ jarFile = jarConnection.getJarFile();
+ }
+ catch (IOException e2)
+ {
+ assert false;
+ }
+ Enumeration enum = jarFile.entries();
+ Set lessonSet = null;
+ while (enum.hasMoreElements())
+ {
+ JarEntry jarEntry = (JarEntry) enum.nextElement();
+ String entryName = jarEntry.getName();
+ if (entryName.startsWith(directoryPath))
+ {
+ if (jarEntry.isDirectory())
+ {
+ lessonSet = new TreeSet();
+ // remove trailing '/'
+ lessonSets.put(entryName.substring(0, entryName.length() - 1), lessonSet);
+ }
+ else
+ {
+ lessonSet.add(entryName);
+ }
+ }
+ }
}
- JCheckBox ck = new JCheckBox(p.getProperty("lessonTitle"), false);
- lessonPanel.add(ck, null);
- lessons.put(ck, children[i].getAbsolutePath());
- }
- lessonDirectory.setText(directoryPath);
- this.pack();
}
+
+ private void loadHomeLessons(String directoryPath)
+ {
+ List files = new ArrayList();
+ getFileListing(new File(directoryPath), files);
+ Collections.sort(files);
+ Iterator iter = files.iterator();
+ Set lessonSet = null;
+ while (iter.hasNext())
+ {
+ File file = (File) iter.next();
+ File parent = file.getParentFile();
+ String parentPath = parent.getPath().replace('\\', '/');
+ if (lessonSets.containsKey(parentPath))
+ {
+ lessonSet = (Set) lessonSets.get(parentPath);
+ }
+ else
+ {
+ lessonSet = new TreeSet();
+ }
+ String filePath = file.getPath().replace('\\', '/');
+ lessonSet.add(filePath);
+ }
+ }
+ private void loadWidgets()
+ {
+ lessons = new Hashtable();
+ Iterator iter = lessonSets.values().iterator();
+ while (iter.hasNext())
+ {
+ Set lessonSet = (Set) iter.next();
+ Iterator lessonIterator = lessonSet.iterator();
+ while (lessonIterator.hasNext())
+ {
+ String lessonName = (String) lessonIterator.next();
+ URL lessonURL = ResourceUtil.getResource(lessonName);
+ Properties p = new Properties();
+ try {
+ p.load(lessonURL.openConnection().getInputStream());
+ }
+ catch (IOException ex) {
+ }
+ JCheckBox ck = new JCheckBox(p.getProperty("lessonTitle"), false);
+ lessonPanel.add(ck, null);
+ lessons.put(ck, lessonURL);
+ }
+ }
+/*
+ * This code (or something like it) is for the future and shows how to use ResourceBundles.
+ * The extension on the files needs to be changed from .flash to .properties
+ * and the name given to getBundle is not to contain .properties.
+ */
+// Locale defaultLocale = Locale.getDefault();
+// while (iter.hasNext())
+// {
+// lessonSet = (Set) iter.next();
+// Iterator lessonIterator = lessonSet.iterator();
+// while (lessonIterator.hasNext())
+// {
+// String lessonName = (String) lessonIterator.next();
+// try
+// {
+// ResourceBundle resources = ResourceBundle.getBundle(lessonName, defaultLocale, new CWClassLoader());
+// JCheckBox ck = new JCheckBox(resources.getString("lessonTitle"), false);
+// lessonPanel.add(ck, null);
+// lessons.put(ck, resources);
+// }
+// catch (MissingResourceException ex)
+// {
+// System.err.println("Cannot get resource " + lessonName + ":lessonTitle"); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+// }
+// }
+ this.pack();
+ }
+ /**
+ * Recursively walk a directory tree and return a List of all
+ * Files found; the List is sorted using File.compareTo.
+ *
+ * @param aStartingDir is a valid directory, which can be read.
+ */
+ public void getFileListing(File aStartingDir, List result) {
+ // look for files that are either directories or end with .flash
+ File[] filesAndDirs = aStartingDir.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ if (name.endsWith(".flash"))
+ {
+ return true;
+ }
+ File testFile = new File(dir.getName() + File.separator + name);
+ return testFile.isDirectory();
+ }
+ });
+ if (filesAndDirs == null)
+ {
+ return;
+ }
+ for (int i = 0; i < filesAndDirs.length; i++)
+ {
+ File file = filesAndDirs[i];
+ if (file.isDirectory()) {
+ // dig deeper
+ getFileListing(file, result);
+ } else {
+ // Add only files
+ result.add(file);
+ }
+ }
+ }
+
void jButton2_actionPerformed(ActionEvent e) {
JFileChooser dialog = new JFileChooser();
dialog.setCurrentDirectory(new File("./"));
- if (dialog.showOpenDialog(this) == dialog.APPROVE_OPTION) {
+ if (dialog.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
lessonDirectory.setText(dialog.getSelectedFile().getParentFile().getAbsolutePath());
- loadLessonDirectory(lessonDirectory.getText());
+ loadLessons(lessonDirectory.getText());
}
}
@@ -202,8 +399,8 @@
if (!ck.isSelected())
continue;
try {
- String fullPath = (String)lessons.get(ck);
- lesson.load(new FileInputStream(fullPath));
+ URL lessonURL = (URL)lessons.get(ck);
+ lesson.load(lessonURL.openConnection().getInputStream());
}
catch (Exception e1) {
e1.printStackTrace();
Modified: trunk/app/src/org/crosswire/flashcards/MainFrame_AboutBox.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/MainFrame_AboutBox.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/flashcards/MainFrame_AboutBox.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,10 +1,21 @@
package org.crosswire.flashcards;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.border.*;
+import java.awt.AWTEvent;
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import javax.swing.BorderFactory;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
/**
* <p>Title: </p>
* <p>Description: </p>
Modified: trunk/app/src/org/crosswire/flashcards/OpenFile.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/OpenFile.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/flashcards/OpenFile.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,8 +1,12 @@
package org.crosswire.flashcards;
-import java.awt.*;
-import javax.swing.*;
+import java.awt.BorderLayout;
+import java.awt.Frame;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+
/**
* <p>Title: </p>
* <p>Description: </p>
Modified: trunk/app/src/org/crosswire/flashcards/Quiz.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/Quiz.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/flashcards/Quiz.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,7 +1,9 @@
package org.crosswire.flashcards;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+
import javax.swing.UIManager;
-import java.awt.*;
/**
* <p>Title: </p>
Modified: trunk/app/src/org/crosswire/modedit/GreekKeymanIM.java
===================================================================
--- trunk/app/src/org/crosswire/modedit/GreekKeymanIM.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/modedit/GreekKeymanIM.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -9,7 +9,7 @@
* @version 1.0
*/
-import java.util.*;
+import java.util.Hashtable;
public class GreekKeymanIM
extends SWInputMethod {
Modified: trunk/app/src/org/crosswire/modedit/HebrewDurusauIM.java
===================================================================
--- trunk/app/src/org/crosswire/modedit/HebrewDurusauIM.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/modedit/HebrewDurusauIM.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -9,7 +9,7 @@
* @version 1.0
*/
-import java.util.*;
+import java.util.Hashtable;
public class HebrewDurusauIM
extends SWInputMethod {
Modified: trunk/app/src/org/crosswire/modedit/HebrewMCIM.java
===================================================================
--- trunk/app/src/org/crosswire/modedit/HebrewMCIM.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/modedit/HebrewMCIM.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -9,7 +9,7 @@
* @version 1.0
*/
-import java.util.*;
+import java.util.Hashtable;
public class HebrewMCIM
extends SWInputMethod {
Modified: trunk/app/src/org/crosswire/modedit/UniTextEdit.java
===================================================================
--- trunk/app/src/org/crosswire/modedit/UniTextEdit.java 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/app/src/org/crosswire/modedit/UniTextEdit.java 2004-09-05 18:58:46 UTC (rev 6)
@@ -1,16 +1,43 @@
package org.crosswire.modedit;
-import java.io.*;
-import java.net.*;
+import java.awt.AWTEvent;
+import java.awt.BorderLayout;
+import java.awt.ComponentOrientation;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.beans.PropertyChangeListener;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.io.StringWriter;
+import java.net.URL;
+import java.net.URLConnection;
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSlider;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
+import javax.swing.event.CaretListener;
+import javax.swing.event.ChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Set;
-
/**
* <p>Title: </p>
* <p>Description: </p>
Added: trunk/build.xml
===================================================================
--- trunk/build.xml 2004-08-18 16:32:15 UTC (rev 5)
+++ trunk/build.xml 2004-09-05 18:58:46 UTC (rev 6)
@@ -0,0 +1,127 @@
+<project name="flashcards" default="all">
+
+ <!--=======================================================================
+ == To make eclipse recognise this file as an ant file, go to preferences,
+ == ant and add core.xml to the "Names" field, and then under Workbench,
+ == "File Associations" add a type "core.xml" with ant as the editor.
+ =========================================================================-->
+
+ <!--=======================================================================
+ == These are the standard locations that this build file uses.
+ == This assumes that the build file is in the root of the project.
+ =========================================================================-->
+ <property name="source.root" value="."/>
+ <property name="source.java" value="${source.root}/app/src"/>
+ <property name="source.res" value="${source.root}"/>
+ <property name="target.root" value="${source.root}/target"/>
+ <property name="target.classes" value="${target.root}/classes"/>
+ <property name="target.install" value="${target.root}/install"/>
+ <property name="keystore.file" value="flshcrds.keystore"/>
+ <property name="keystore.alias" value="flshcrds"/>
+ <property name="keystore.pswd" value="p455w0rd"/>
+
+ <!--=======================================================================
+ == This is a path to all source directories and files.
+ =========================================================================-->
+ <path id="source.path">
+ <dirset dir="${source.java}" includes="*"/>
+ </path>
+
+ <!--=======================================================================
+ == Mark this build with the current timestamp
+ =========================================================================-->
+ <target name="init" description="Prepare for other tasks">
+ <echo message="Initializing ${ant.project.name}"/>
+ <tstamp/>
+ </target>
+
+ <!--=======================================================================
+ == Clean the intermediate files and build everything
+ =========================================================================-->
+ <target name="all"
+ depends="clean, build"
+ description="Run a full clean/build cycle">
+ </target>
+
+ <!--=======================================================================
+ == Clean the intermediate files.
+ == Also invoke a clean on any dependencies, if any.
+ =========================================================================-->
+ <target name="clean"
+ depends="init"
+ description="Remove the target directory">
+ <delete dir="${target.root}"/>
+ </target>
+
+ <!--=======================================================================
+ == Build all the java files into class files and
+ == create a jar file for the project with the name project.jar,
+ == where project is replaced with the name of the project.
+ == This jar is built to the target.install directory.
+ =========================================================================-->
+ <target name="build" depends="compile, jar.check, keygen" unless="jar.uptodate" description="Run a full build">
+ <mkdir dir="${target.install}"/>
+ <jar jarfile="${target.install}/${ant.project.name}.jar">
+ <fileset dir="${target.classes}"/>
+ <fileset dir="${source.root}" includes="lessons/**/*"/>
+ </jar>
+ <copy todir="${target.install}">
+ <fileset dir="${source.root}/app/webstart">
+ <include name="FlashCards.jnlp"/>
+ <include name="*.gif"/>
+ </fileset>
+ </copy>
+
+ <signjar
+ storepass="${keystore.pswd}"
+ alias="${keystore.alias}"
+ keystore="${keystore.file}"
+ keypass="${keystore.pswd}"
+ jar="${target.install}/${ant.project.name}.jar"/>
+ </target>
+ <target name="jar.check">
+ <uptodate property="jar.uptodate"
+ targetfile="${target.install}/${ant.project.name}.jar">
+ <srcfiles dir="${target.classes}"/>
+ <srcfiles dir="${source.res}"/>
+ </uptodate>
+ </target>
+
+ <!--=======================================================================
+ == Compile all the java files under source.path into class files.
+ == Make sure that all the resources in those directories make it over too.
+ =========================================================================-->
+ <target name="compile" description="Compile the source">
+ <mkdir dir="${target.classes}"/>
+ <javac debug="on"
+ includes="**/*.java"
+ destdir="${target.classes}"
+ source="1.4">
+ <src refid="source.path"/>
+ </javac>
+ </target>
+
+ <!--=======================================================================
+ == A keystore is needed to sign jars.
+ == It does not need to be build very often and can be shared.
+ =========================================================================-->
+ <target name="keygen"
+ depends="keygen.check"
+ unless="keygen.uptodate"
+ description="Generates a key for use in signing the JARs">
+ <echo message="Generating keystore for signing jars"/>
+ <genkey alias="${keystore.alias}"
+ storepass="${keystore.pswd}"
+ keystore="${keystore.file}">
+ <dname>
+ <param name="CN" value="The CrossWire Bible Society"/>
+ <param name="OU" value="FlashCards"/>
+ <param name="O" value="Crosswire.org"/>
+ </dname>
+ </genkey>
+ </target>
+ <target name="keygen.check" description="Check the keystore is there">
+ <available property="keygen.uptodate" file="${keystore.file}"/>
+ </target>
+
+</project>
More information about the sword-cvs
mailing list