[sword-svn] r73 - in trunk/app: . src/org/crosswire/common
src/org/crosswire/common/swing src/org/crosswire/flashcards
src/org/crosswire/modedit
Apache
apache at crosswire.org
Sat Oct 30 19:47:30 MST 2004
Author:
Date: 2004-10-30 19:47:29 -0700 (Sat, 30 Oct 2004)
New Revision: 73
Removed:
trunk/app/src/org/crosswire/common/swing/FixedSplitPane.java
trunk/app/src/org/crosswire/common/util/
Modified:
trunk/app/Flash.jpx
trunk/app/Flash.jpx.local
trunk/app/src/org/crosswire/flashcards/EditPane.java
trunk/app/src/org/crosswire/flashcards/FlashCardColumns.java
trunk/app/src/org/crosswire/flashcards/Lesson.java
trunk/app/src/org/crosswire/flashcards/LessonManager.java
trunk/app/src/org/crosswire/flashcards/LessonSet.java
trunk/app/src/org/crosswire/flashcards/SetupPane.java
trunk/app/src/org/crosswire/modedit/UniTextEdit.java
Log:
major persistence updates
-TAG.
Modified: trunk/app/Flash.jpx
===================================================================
--- trunk/app/Flash.jpx 2004-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/Flash.jpx 2004-10-31 02:47:29 UTC (rev 73)
@@ -1,65 +1,176 @@
-<?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="JbxEventListener0" value="org.crosswire.flashcards.FlashCardEventListener"/>
- <property category="sys" name="JbxEventListener1" value="org.crosswire.flashcards.FlashCardEventListener"/>
- <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>
+<?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="generalFormatting" name="blockIndent" value="5"/>
+ <property category="generalFormatting" name="continuationIndent" value="10"/>
+ <property category="generalFormatting" name="tabSize" value="5"/>
+ <property category="generalFormatting2" name="blockIndent" value="5"/>
+ <property category="generalFormatting2" name="continuationIndent" value="10"/>
+ <property category="generalFormatting2" name="tabSize" value="5"/>
+ <property category="java.sapient" name="ACE" value="false"/>
+ <property category="java.sapient" name="AFLV" value="true"/>
+ <property category="java.sapient" name="AFP" value="false"/>
+ <property category="java.sapient" name="ASMDCN" value="true"/>
+ <property category="java.sapient" name="ASMO" value="true"/>
+ <property category="java.sapient" name="BSMC" value="true"/>
+ <property category="java.sapient" name="BTJC" value="false"/>
+ <property category="java.sapient" name="CA" value="false"/>
+ <property category="java.sapient" name="CEV" value="false"/>
+ <property category="java.sapient" name="CFPV" value="false"/>
+ <property category="java.sapient" name="CIUCFL" value="true"/>
+ <property category="java.sapient" name="CQS" value="false"/>
+ <property category="java.sapient" name="CSR" value="true"/>
+ <property category="java.sapient" name="CVSBF" value="true"/>
+ <property category="java.sapient" name="EIAV" value="false"/>
+ <property category="java.sapient" name="EJB_CL" value="false"/>
+ <property category="java.sapient" name="EJB_CONSOLE" value="false"/>
+ <property category="java.sapient" name="EJB_ENTITY" value="false"/>
+ <property category="java.sapient" name="EJB_FDESCR" value="false"/>
+ <property category="java.sapient" name="EJB_FILES" value="false"/>
+ <property category="java.sapient" name="EJB_HOME" value="false"/>
+ <property category="java.sapient" name="EJB_IO" value="false"/>
+ <property category="java.sapient" name="EJB_JDBC" value="false"/>
+ <property category="java.sapient" name="EJB_MESSAGE" value="false"/>
+ <property category="java.sapient" name="EJB_NAMES" value="false"/>
+ <property category="java.sapient" name="EJB_NATIVE" value="false"/>
+ <property category="java.sapient" name="EJB_OBJECT" value="false"/>
+ <property category="java.sapient" name="EJB_REFL" value="false"/>
+ <property category="java.sapient" name="EJB_SEC" value="false"/>
+ <property category="java.sapient" name="EJB_SECOBJ" value="false"/>
+ <property category="java.sapient" name="EJB_SESSION" value="false"/>
+ <property category="java.sapient" name="EJB_SFACT" value="false"/>
+ <property category="java.sapient" name="EJB_SOCKET" value="false"/>
+ <property category="java.sapient" name="EJB_SUBST" value="false"/>
+ <property category="java.sapient" name="EJB_THREADS" value="false"/>
+ <property category="java.sapient" name="EOBA" value="true"/>
+ <property category="java.sapient" name="EVC" value="true"/>
+ <property category="java.sapient" name="HIF" value="true"/>
+ <property category="java.sapient" name="HISM" value="true"/>
+ <property category="java.sapient" name="HN" value="true"/>
+ <property category="java.sapient" name="ICSBF" value="false"/>
+ <property category="java.sapient" name="IFM" value="true"/>
+ <property category="java.sapient" name="ILC" value="false"/>
+ <property category="java.sapient" name="IMCM" value="true"/>
+ <property category="java.sapient" name="IMMD" value="true"/>
+ <property category="java.sapient" name="LF" value="false"/>
+ <property category="java.sapient" name="LMC" value="false"/>
+ <property category="java.sapient" name="LNU" value="true"/>
+ <property category="java.sapient" name="MCP" value="true"/>
+ <property category="java.sapient" name="MCS" value="true"/>
+ <property category="java.sapient" name="MLOWP" value="false"/>
+ <property category="java.sapient" name="MNU" value="true"/>
+ <property category="java.sapient" name="MSOL" value="true"/>
+ <property category="java.sapient" name="MVDSN" value="false"/>
+ <property category="java.sapient" name="NC" value="true"/>
+ <property category="java.sapient" name="NCLS" value="true"/>
+ <property category="java.sapient" name="NFSF" value="false"/>
+ <property category="java.sapient" name="NLC" value="false"/>
+ <property category="java.sapient" name="NOIS" value="false"/>
+ <property category="java.sapient" name="ODCM" value="false"/>
+ <property category="java.sapient" name="OHCE" value="true"/>
+ <property category="java.sapient" name="OIM" value="true"/>
+ <property category="java.sapient" name="ONAMAM" value="true"/>
+ <property category="java.sapient" name="ONE" value="true"/>
+ <property category="java.sapient" name="OPM" value="true"/>
+ <property category="java.sapient" name="OSNBU" value="false"/>
+ <property category="java.sapient" name="OWS" value="false"/>
+ <property category="java.sapient" name="PCO" value="true"/>
+ <property category="java.sapient" name="PDBB" value="false"/>
+ <property category="java.sapient" name="PFC" value="false"/>
+ <property category="java.sapient" name="PIFS" value="false"/>
+ <property category="java.sapient" name="PJDC" value="false"/>
+ <property category="java.sapient" name="PMSNT" value="false"/>
+ <property category="java.sapient" name="PN" value="false"/>
+ <property category="java.sapient" name="PPA" value="false"/>
+ <property category="java.sapient" name="PPCF" value="true"/>
+ <property category="java.sapient" name="PSIB" value="true"/>
+ <property category="java.sapient" name="RIP" value="false"/>
+ <property category="java.sapient" name="SBC" value="true"/>
+ <property category="java.sapient" name="SEB" value="false"/>
+ <property category="java.sapient" name="SL" value="false"/>
+ <property category="java.sapient" name="SSSIDC" value="false"/>
+ <property category="java.sapient" name="SU" value="true"/>
+ <property category="java.sapient" name="TMSSC" value="false"/>
+ <property category="java.sapient" name="UAAO" value="true"/>
+ <property category="java.sapient" name="UC" value="true"/>
+ <property category="java.sapient" name="UCVN" value="false"/>
+ <property category="java.sapient" name="UE" value="true"/>
+ <property category="java.sapient" name="UL" value="true"/>
+ <property category="java.sapient" name="ULVFP" value="true"/>
+ <property category="java.sapient" name="UMM" value="true"/>
+ <property category="java.sapient" name="URSP" value="true"/>
+ <property category="java.sapient" name="enable" value="1"/>
+ <property category="javaFormatting" name="alwaysClasses" value="1"/>
+ <property category="javaFormatting" name="blankLinesAfterClass" value="2"/>
+ <property category="javaFormatting" name="blankLinesAfterImports" value="2"/>
+ <property category="javaFormatting" name="blankLinesAfterMethod" value="2"/>
+ <property category="javaFormatting" name="packagePrefixGroups" value="java;javax;BLANK_LINE;java.awt;javax.swing;BLANK_LINE;org;(*)"/>
+ <property category="javaFormatting" name="preserveLineBreaks" value="0"/>
+ <property category="javaFormatting" name="wrapAtColumn" value="120"/>
+ <property category="module" name="ProjectConvertedToEnsureModulesHaveSupportedFeatures" value="1"/>
+ <property category="module" name="ProjectConvertedToUseFilesAndDependenciesAsDefaultContent" value="1"/>
+ <property category="module" name="ProjectConvertedToUseProperModuleDefaults" value="1"/>
+ <property category="module" name="projectConvertedFromModuleExtensionsToModuleFileTypes" value="1"/>
+ <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="disabled.services" value="jdatastore"/>
+ <property category="serverservices" name="single.server.name" value="Tomcat 4.1"/>
+ <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_04-b05"/>
+ <property category="sys" name="JbxEventListener0" value="org.crosswire.flashcards.FlashCardEventListener"/>
+ <property category="sys" name="JbxEventListener1" value="org.crosswire.flashcards.FlashCardEventListener"/>
+ <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-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/Flash.jpx.local 2004-10-31 02:47:29 UTC (rev 73)
@@ -5,13 +5,25 @@
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"?>`n<project-layout>`n <tab_container selected_index="0">`n <tab node_name="src/org/crosswire/flashcards/LessonManager.java"/>`n </tab_container>`n</project-layout>`n
+content.layout.xml.[0]=<project-layout><tab_container selected_index="1"><tab node_name="src/org/crosswire/common/bak/util/CallContext.java"/><tab node_name="src/org/crosswire/flashcards/EditPane.java"/><tab node_name="src/org/crosswire/flashcards/FlashCardColumns.java"/><tab node_name="src/org/crosswire/flashcards/FlashCardPane.java"/><tab node_name="[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/util/Iterator.java"/><tab node_name="src/org/crosswire/flashcards/Lesson.java"/><tab node_name="src/org/crosswire/flashcards/LessonManager.java"/><tab node_name="src/org/crosswire/flashcards/LessonSet.java"/><tab node_name="src/org/crosswire/common/swing/RowTable.java"/><tab node_name="src/org/crosswire/flashcards/SetupPane.java"/></tab_container></project-layout>
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/flashcards/LessonManager.java
-history.files.open.1[0]=src/org/crosswire/flashcards/LessonManager.java,F;119,4191
+debug.Watches.1[0]=1 110 lessonPath10 expression1 02 501 01 01 01 1 -1
+debug.Watches.2[0]=1 111 description10 expression1 02 501 01 01 01 1 -1
+debug.Watches.3[0]=1 19 entryName10 expression1 02 501 01 01 01 1 -1
+history.files.active[0]=src/org/crosswire/flashcards/EditPane.java,F;53,6541
+history.files.open.1[0]=src/org/crosswire/common/bak/util/CallContext.java,F;1,0
+history.files.open.10[0]=src/org/crosswire/flashcards/SetupPane.java,F;71,2278
+history.files.open.2[0]=src/org/crosswire/flashcards/EditPane.java,F;53,6541
+history.files.open.3[0]=src/org/crosswire/flashcards/FlashCardColumns.java,F;1,687
+history.files.open.4[0]=src/org/crosswire/flashcards/FlashCardPane.java,F;41,1342
+history.files.open.5[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/util/Iterator.java,F;29,1367
+history.files.open.6[0]=src/org/crosswire/flashcards/Lesson.java,F;93,2684
+history.files.open.7[0]=src/org/crosswire/flashcards/LessonManager.java,F;62,2839
+history.files.open.8[0]=src/org/crosswire/flashcards/LessonSet.java,F;244,8231
+history.files.open.9[0]=src/org/crosswire/common/swing/RowTable.java,F;227,6666
import.optimize.legacyPropertiesRead[0]=1
java.classdefaults.1[0]=java.util.Enumeration
java.classdefaults.2[0]=javax.swing.filechooser.FileFilter
@@ -19,60 +31,74 @@
java.classdefaults.4[0]=java.util.Hashtable
java.classdefaults.5[0]=java.util.Set
java.classdefaults.6[0]=org.crosswire.flashcards.Debug
+java.classdefaults.7[0]=java.net.JarURLConnection
packagebrowser.lastClassName[0]=org.crosswire.flashcards.Editor
sys.Author[0]=
sys.DefaultPackage[0]=flash
-sys.ReopenHistory.1[0]=src/org/crosswire/flashcards/migrate/ImportLesson.java
-sys.ReopenHistory.10[0]=src/org/crosswire/modedit/GreekKeymanIM.java
-sys.ReopenHistory.11[0]=src/org/crosswire/flashcards/FlashCardColumns.java
-sys.ReopenHistory.12[0]=src/org/crosswire/modedit/CGreekIM.java
-sys.ReopenHistory.13[0]=E%|/Eclipse/JSword/flashcards/target/jar/flashcards.jar
-sys.ReopenHistory.14[0]=E%|/Eclipse/JSword/flashcards/lessons/black/eimi_pi.flash
-sys.ReopenHistory.15[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter21vocab.flash
-sys.ReopenHistory.16[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter19vocab.flash
-sys.ReopenHistory.17[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter18vocab.flash
-sys.ReopenHistory.18[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter17vocab.flash
-sys.ReopenHistory.19[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter15vocab.flash
-sys.ReopenHistory.2[0]=src/org/crosswire/modedit/SWInputMethod.java
-sys.ReopenHistory.20[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter14vocab.flash
-sys.ReopenHistory.21[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter13vocab.flash
-sys.ReopenHistory.22[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter12vocab.flash
-sys.ReopenHistory.23[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter11vocab.flash
-sys.ReopenHistory.24[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter10vocab.flash
-sys.ReopenHistory.25[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter09vocab.flash
-sys.ReopenHistory.26[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter08vocab.flash
-sys.ReopenHistory.27[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter07vocab.flash
-sys.ReopenHistory.28[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter06vocab.flash
-sys.ReopenHistory.29[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter05vocab.flash
-sys.ReopenHistory.3[0]=src/org/crosswire/flashcards/SetupPane.java
-sys.ReopenHistory.30[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter04vocab.flash
-sys.ReopenHistory.31[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter03vocab.flash
-sys.ReopenHistory.32[0]=Flash.jar
-sys.ReopenHistory.33[0]=src/org/crosswire/flashcards/MainFrame_AboutBox.java
-sys.ReopenHistory.34[0]=src/org/crosswire/flashcards/EditorFrame_AboutBox.java
-sys.ReopenHistory.35[0]=src/org/crosswire/flashcards/EditorFrame.java
-sys.ReopenHistory.36[0]=src/flash/Quiz.java
-sys.ReopenHistory.37[0]=src/flash/openFile.png
-sys.ReopenHistory.38[0]=src/flash/OpenFile.java
-sys.ReopenHistory.39[0]=src/flash/MainFrame_AboutBox.java
-sys.ReopenHistory.4[0]=src/org/crosswire/modedit/NullIM.java
-sys.ReopenHistory.40[0]=src/flash/MainFrame.java
-sys.ReopenHistory.41[0]=src/flash/help.png
-sys.ReopenHistory.42[0]=Flash.html
-sys.ReopenHistory.43[0]=src/flash/EditorFrame_AboutBox.java
-sys.ReopenHistory.44[0]=src/flash/EditorFrame.java
-sys.ReopenHistory.45[0]=src/flash/Editor.java
-sys.ReopenHistory.46[0]=src/flash/closeFile.png
-sys.ReopenHistory.47[0]=src/flash/about.png
-sys.ReopenHistory.48[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/java/awt/Font.java
-sys.ReopenHistory.49[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/javax/swing/JFileChooser.java
-sys.ReopenHistory.5[0]=src/org/crosswire/flashcards/MainFrame.java
-sys.ReopenHistory.50[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/javax/swing/text/JTextComponent.java
-sys.ReopenHistory.51[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/java/util/Properties.java
-sys.ReopenHistory.6[0]=src/org/crosswire/modedit/Ibycus4IM.java
-sys.ReopenHistory.7[0]=src/org/crosswire/modedit/HebrewMCIM.java
-sys.ReopenHistory.8[0]=src/org/crosswire/modedit/HebrewDurusauIM.java
-sys.ReopenHistory.9[0]=src/org/crosswire/modedit/Gtk2ClassicalGreekIM.java
+sys.ReopenHistory.1[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/util/Set.java
+sys.ReopenHistory.10[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/net/JarURLConnection.java
+sys.ReopenHistory.11[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/net/URLConnection.java
+sys.ReopenHistory.12[0]=src/org/crosswire/flashcards/migrate/ImportLesson.java
+sys.ReopenHistory.13[0]=src/org/crosswire/modedit/SWInputMethod.java
+sys.ReopenHistory.14[0]=src/org/crosswire/flashcards/SetupPane.java
+sys.ReopenHistory.15[0]=src/org/crosswire/modedit/NullIM.java
+sys.ReopenHistory.16[0]=src/org/crosswire/flashcards/MainFrame.java
+sys.ReopenHistory.17[0]=src/org/crosswire/modedit/Ibycus4IM.java
+sys.ReopenHistory.18[0]=src/org/crosswire/modedit/HebrewMCIM.java
+sys.ReopenHistory.19[0]=src/org/crosswire/modedit/HebrewDurusauIM.java
+sys.ReopenHistory.2[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/io/File.java
+sys.ReopenHistory.20[0]=src/org/crosswire/modedit/Gtk2ClassicalGreekIM.java
+sys.ReopenHistory.21[0]=src/org/crosswire/modedit/GreekKeymanIM.java
+sys.ReopenHistory.22[0]=src/org/crosswire/flashcards/FlashCardColumns.java
+sys.ReopenHistory.23[0]=src/org/crosswire/modedit/CGreekIM.java
+sys.ReopenHistory.24[0]=E%|/Eclipse/JSword/flashcards/target/jar/flashcards.jar
+sys.ReopenHistory.25[0]=E%|/Eclipse/JSword/flashcards/lessons/black/eimi_pi.flash
+sys.ReopenHistory.26[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter21vocab.flash
+sys.ReopenHistory.27[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter19vocab.flash
+sys.ReopenHistory.28[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter18vocab.flash
+sys.ReopenHistory.29[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter17vocab.flash
+sys.ReopenHistory.3[0]=[/space/opt/JBuilder2005/jdk1.4/jre/lib/rt.jar]/sun/misc/Launcher.class
+sys.ReopenHistory.30[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter15vocab.flash
+sys.ReopenHistory.31[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter14vocab.flash
+sys.ReopenHistory.32[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter13vocab.flash
+sys.ReopenHistory.33[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter12vocab.flash
+sys.ReopenHistory.34[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter11vocab.flash
+sys.ReopenHistory.35[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter10vocab.flash
+sys.ReopenHistory.36[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter09vocab.flash
+sys.ReopenHistory.37[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter08vocab.flash
+sys.ReopenHistory.38[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter07vocab.flash
+sys.ReopenHistory.39[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter06vocab.flash
+sys.ReopenHistory.4[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/net/URL.java
+sys.ReopenHistory.40[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter05vocab.flash
+sys.ReopenHistory.41[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter04vocab.flash
+sys.ReopenHistory.42[0]=E%|/Eclipse/JSword/flashcards/lessons/black/chapter03vocab.flash
+sys.ReopenHistory.43[0]=Flash.jar
+sys.ReopenHistory.44[0]=src/org/crosswire/flashcards/MainFrame_AboutBox.java
+sys.ReopenHistory.45[0]=src/org/crosswire/flashcards/EditorFrame_AboutBox.java
+sys.ReopenHistory.46[0]=src/org/crosswire/flashcards/EditorFrame.java
+sys.ReopenHistory.47[0]=src/flash/Quiz.java
+sys.ReopenHistory.48[0]=src/flash/openFile.png
+sys.ReopenHistory.49[0]=src/flash/OpenFile.java
+sys.ReopenHistory.5[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/util/TreeSet.java
+sys.ReopenHistory.50[0]=src/flash/MainFrame_AboutBox.java
+sys.ReopenHistory.51[0]=src/flash/MainFrame.java
+sys.ReopenHistory.52[0]=src/flash/help.png
+sys.ReopenHistory.53[0]=Flash.html
+sys.ReopenHistory.54[0]=src/flash/EditorFrame_AboutBox.java
+sys.ReopenHistory.55[0]=src/flash/EditorFrame.java
+sys.ReopenHistory.56[0]=src/flash/Editor.java
+sys.ReopenHistory.57[0]=src/flash/closeFile.png
+sys.ReopenHistory.58[0]=src/flash/about.png
+sys.ReopenHistory.59[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/java/awt/Font.java
+sys.ReopenHistory.6[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/lang/StringBuffer.java
+sys.ReopenHistory.60[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/javax/swing/JFileChooser.java
+sys.ReopenHistory.61[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/javax/swing/text/JTextComponent.java
+sys.ReopenHistory.62[0]=[/space/opt/JBuilderX/jdk1.4/src.zip]/java/util/Properties.java
+sys.ReopenHistory.7[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/lang/System.java
+sys.ReopenHistory.8[0]=src/org/crosswire/common/util/CWClassLoader.java
+sys.ReopenHistory.9[0]=[/space/opt/JBuilder2005/jdk1.4/src.zip]/java/lang/Class.java
+team.ActiveVCS[0]=Subversion
+team.lastScanned[0]=1099190668569
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
Deleted: trunk/app/src/org/crosswire/common/swing/FixedSplitPane.java
===================================================================
--- trunk/app/src/org/crosswire/common/swing/FixedSplitPane.java 2004-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/src/org/crosswire/common/swing/FixedSplitPane.java 2004-10-31 02:47:29 UTC (rev 73)
@@ -1,197 +0,0 @@
-package org.crosswire.common.swing;
-
-import java.awt.Component;
-import java.awt.Dimension;
-
-import javax.swing.JComponent;
-import javax.swing.JSplitPane;
-
-/**
- * This is a hack to fix the setDividerLocation problem and other layout problems.
- * <p>
- * See Bug Parade 4101306, 4485465 for a description of the WIDE divider problem.
- * <p>
- * Bug Reports on JSplitpane setDividerLocation<br>
- * 4101306, 4125713, 4148530
- *<p>
- * From the javadoc for setDividerLocation(double):
- * -------------------------------------------<br>
- * <p>This method is implemented in terms of setDividerLocation(int).
- * This method immediately changes the size of the receiver based on
- * its current size. If the receiver is not correctly realized and on
- * screen, this method will have no effect (new divider location will
- * become (current size * proportionalLocation) which is 0).<br>
- * -------------------------------------------<br>
- * So, as you can see the JSplitPane MUST be visible invoking this method
- * otherwise it will not have the desired effect.
- * <p>
- * Another, Bug Report 4786896 notes that if the preferred sizes of the
- * two components plus the divider of the split pane adds up to more than
- * the preferred size of the JSplitPane, then JSplitPane will use the
- * minimum size of the components.
- * <p>
- * Since the preferred way of managing the sizes of containers is not with
- * pixel counts, the solution here is to set the preferred size to zero.
- *
- * <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: FixedSplitPane.java,v 1.3 2004/09/08 19:54:24 dmsmith Exp $
- */
-public class FixedSplitPane extends JSplitPane
-{
- /**
- * Constructor for FixedSplitPane
- */
- public FixedSplitPane()
- {
- super();
- }
-
- /**
- * Constructor for FixedSplitPane
- */
- public FixedSplitPane(int arg0)
- {
- super(arg0);
- }
-
- /**
- * Constructor for FixedSplitPane
- */
- public FixedSplitPane(int arg0, boolean arg1)
- {
- super(arg0, arg1);
- }
-
- /**
- * Constructor for FixedSplitPane
- */
- public FixedSplitPane(int arg0, Component arg1, Component arg2)
- {
- super(arg0, arg1, arg2);
- }
-
- /**
- * Constructor for FixedSplitPane
- */
- public FixedSplitPane(int arg0, boolean arg1, Component arg2, Component arg3)
- {
- super(arg0, arg1, arg2, arg3);
- }
-
- /* (non-Javadoc)
- * @see java.awt.Container#addImpl(java.awt.Component, java.lang.Object, int)
- */
- protected void addImpl(Component comp, Object constraints, int index)
- {
- if (comp instanceof JComponent)
- {
- ((JComponent) comp).setPreferredSize(DOT);
- }
- super.addImpl(comp, constraints, index);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.JSplitPane#setBottomComponent(java.awt.Component)
- */
- public void setBottomComponent(Component comp)
- {
- if (comp instanceof JComponent)
- {
- ((JComponent) comp).setPreferredSize(DOT);
- }
- super.setBottomComponent(comp);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.JSplitPane#setLeftComponent(java.awt.Component)
- */
- public void setLeftComponent(Component comp)
- {
- if (comp instanceof JComponent)
- {
- ((JComponent) comp).setPreferredSize(DOT);
- }
- super.setLeftComponent(comp);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.JSplitPane#setRightComponent(java.awt.Component)
- */
- public void setRightComponent(Component comp)
- {
- if (comp instanceof JComponent)
- {
- ((JComponent) comp).setPreferredSize(DOT);
- }
- super.setRightComponent(comp);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.JSplitPane#setTopComponent(java.awt.Component)
- */
- public void setTopComponent(Component comp)
- {
- if (comp instanceof JComponent)
- {
- ((JComponent) comp).setPreferredSize(DOT);
- }
- super.setTopComponent(comp);
- }
-
- /**
- * Validates this container and all of its subcomponents. The first time
- * this method is called, the initial divider position is set.
- */
- public void validate()
- {
- if (firstValidate)
- {
- firstValidate = false;
- if (hasProportionalLocation)
- {
- setDividerLocation(proportionalLocation);
- }
- }
- super.validate();
- }
-
- /**
- * Sets the divider location as a percentage of the JSplitPane's size.
- */
- public void setDividerLocation(double newProportionalLocation)
- {
- if (!firstValidate)
- {
- hasProportionalLocation = true;
- proportionalLocation = newProportionalLocation;
- }
- else
- {
- super.setDividerLocation(newProportionalLocation);
- }
- }
-
- private static final Dimension DOT = new Dimension(0, 0);
- private boolean firstValidate = true;
- private boolean hasProportionalLocation;
- private double proportionalLocation;
-}
Modified: trunk/app/src/org/crosswire/flashcards/EditPane.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/EditPane.java 2004-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/src/org/crosswire/flashcards/EditPane.java 2004-10-31 02:47:29 UTC (rev 73)
@@ -33,7 +33,7 @@
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
-import org.crosswire.common.swing.FixedSplitPane;
+//import org.crosswire.common.swing.FixedSplitPane;
/**
@@ -166,20 +166,20 @@
}
});
- JSplitPane lessonSplitPane = new FixedSplitPane();
+ JSplitPane lessonSplitPane = new JSplitPane();
lessonSplitPane.setResizeWeight(0.5D);
lessonSplitPane.setDividerLocation(0.5D);
lessonSplitPane.setLeftComponent(lessonSetPanel);
lessonSplitPane.setRightComponent(lessonPanel);
- JSplitPane flashCardSplitPane = new FixedSplitPane();
+ JSplitPane flashCardSplitPane = new JSplitPane();
flashCardSplitPane.setResizeWeight(0.5D);
flashCardSplitPane.setDividerLocation(0.5D);
flashCardSplitPane.setLeftComponent(flashCardPanel);
flashCardSplitPane.setRightComponent(flashCardEditor);
flashCardSplitPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "Flash Cards: "));
- JSplitPane verticalSplitPane = new FixedSplitPane(JSplitPane.VERTICAL_SPLIT);
+ JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
verticalSplitPane.setDividerLocation(0.35D);
verticalSplitPane.setResizeWeight(0.35D);
verticalSplitPane.setTopComponent(lessonSplitPane);
Modified: trunk/app/src/org/crosswire/flashcards/FlashCardColumns.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/FlashCardColumns.java 2004-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/src/org/crosswire/flashcards/FlashCardColumns.java 2004-10-31 02:47:29 UTC (rev 73)
@@ -6,7 +6,7 @@
* 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.
* The License is available on the internet at:
* http://www.gnu.org/copyleft/gpl.html,
@@ -14,150 +14,149 @@
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307, USA
- *
- * The copyright to this program is held by it's authors
- * Copyright: 2004
+ *
+ * Copyright: 2004 CrossWire Bible Society
*/
package org.crosswire.flashcards;
import org.crosswire.common.swing.RowColumns;
-/**
+/**
* Defines the prototypes needed to display a FlashCard in a RowTable.
- *
- * @author DM Smith [ dmsmith555 at yahoo dot com]
- */
-public class FlashCardColumns extends RowColumns
-{
- /**
- * Field HEADERS
- * The names of the table column headers.
- */
- private static final String[] HEADERS =
- {
- "Front", "Back" //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- /**
- * Field HEADER_TOOLTIPS
- * The tooltips for the table column headers.
- */
- private static final String[] HEADER_TOOLTIPS =
- {
- "Front of the FlashCard", "Back of the FlashCard" //$NON-NLS-1$ //$NON-NLS-2$
- };
-
- /**
- * Field CHARACTER_WIDTHS
- * The widths of each column in Standard Characters.
- */
- private static final int[] CHARACTER_WIDTHS =
- {
- 16, 32
- };
-
- /**
- * Field FIXED_WIDTHS
- * The columns that cannot be resized are true.
- * The columns that can be resized are false.
- */
- private static final boolean[] FIXED_WIDTHS =
- {
- false, false
- };
-
- /**
- * Field CLASSES
- * Gives object type of contained in each of the column.
- */
- private static final Class[] CLASSES =
- {
- String.class, String.class
- };
-
- /**
- * Field SORT_KEYS
- * The numerical index (0 based) of the columns that
- * participate in default sorting and column
- * sorting.
- */
- private static final int[] SORT_KEYS =
- {
- 0
- };
-
- /**
- * Field TABLE_NAME
- * The Title of the table displayed in a titled border.
- */
- private static final String TABLE_NAME = "FlashCards: "; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see FlashCardColumns#getHeaders()
- */
- public String[] getHeaders()
- {
- return FlashCardColumns.HEADERS;
- }
-
- /* (non-Javadoc)
- * @see FlashCardColumns#getHeaderToolTips()
- */
- public String[] getHeaderToolTips()
- {
- return FlashCardColumns.HEADER_TOOLTIPS;
- }
-
- /* (non-Javadoc)
- * @see FlashCardColumns#getCharacterWidths()
- */
- public int[] getCharacterWidths()
- {
- return FlashCardColumns.CHARACTER_WIDTHS;
- }
-
- /* (non-Javadoc)
- * @see FlashCardColumns#getFixedWidths()
- */
- public boolean[] getFixedWidths()
- {
- return FlashCardColumns.FIXED_WIDTHS;
- }
-
- /* (non-Javadoc)
- * @see FlashCardColumns#getClasses()
- */
- public Class[] getClasses()
- {
- return FlashCardColumns.CLASSES;
- }
-
- /* (non-Javadoc)
- * @see FlashCardColumns#getSortKeys()
- */
- public int[] getSortKeys()
- {
- return FlashCardColumns.SORT_KEYS;
- }
-
- /* (non-Javadoc)
- * @see RowColumns#getValueAt(java.lang.Object, int)
- */
- public Object getValueAt(Object row, int columnIndex)
- {
- FlashCard flashCard = (FlashCard) row;
- if (flashCard != null)
- {
+ *
+ * @author DM Smith [ dmsmith555 at yahoo dot com]
+ */
+public class FlashCardColumns extends RowColumns
+{
+ /**
+ * Field HEADERS
+ * The names of the table column headers.
+ */
+ private static final String[] HEADERS =
+ {
+ "Front", "Back" //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ /**
+ * Field HEADER_TOOLTIPS
+ * The tooltips for the table column headers.
+ */
+ private static final String[] HEADER_TOOLTIPS =
+ {
+ "Front of the FlashCard", "Back of the FlashCard" //$NON-NLS-1$ //$NON-NLS-2$
+ };
+
+ /**
+ * Field CHARACTER_WIDTHS
+ * The widths of each column in Standard Characters.
+ */
+ private static final int[] CHARACTER_WIDTHS =
+ {
+ 16, 32
+ };
+
+ /**
+ * Field FIXED_WIDTHS
+ * The columns that cannot be resized are true.
+ * The columns that can be resized are false.
+ */
+ private static final boolean[] FIXED_WIDTHS =
+ {
+ false, false
+ };
+
+ /**
+ * Field CLASSES
+ * Gives object type of contained in each of the column.
+ */
+ private static final Class[] CLASSES =
+ {
+ String.class, String.class
+ };
+
+ /**
+ * Field SORT_KEYS
+ * The numerical index (0 based) of the columns that
+ * participate in default sorting and column
+ * sorting.
+ */
+ private static final int[] SORT_KEYS =
+ {
+ 0
+ };
+
+ /**
+ * Field TABLE_NAME
+ * The Title of the table displayed in a titled border.
+ */
+ private static final String TABLE_NAME = "FlashCards: "; //$NON-NLS-1$
+
+ /* (non-Javadoc)
+ * @see FlashCardColumns#getHeaders()
+ */
+ public String[] getHeaders()
+ {
+ return FlashCardColumns.HEADERS;
+ }
+
+ /* (non-Javadoc)
+ * @see FlashCardColumns#getHeaderToolTips()
+ */
+ public String[] getHeaderToolTips()
+ {
+ return FlashCardColumns.HEADER_TOOLTIPS;
+ }
+
+ /* (non-Javadoc)
+ * @see FlashCardColumns#getCharacterWidths()
+ */
+ public int[] getCharacterWidths()
+ {
+ return FlashCardColumns.CHARACTER_WIDTHS;
+ }
+
+ /* (non-Javadoc)
+ * @see FlashCardColumns#getFixedWidths()
+ */
+ public boolean[] getFixedWidths()
+ {
+ return FlashCardColumns.FIXED_WIDTHS;
+ }
+
+ /* (non-Javadoc)
+ * @see FlashCardColumns#getClasses()
+ */
+ public Class[] getClasses()
+ {
+ return FlashCardColumns.CLASSES;
+ }
+
+ /* (non-Javadoc)
+ * @see FlashCardColumns#getSortKeys()
+ */
+ public int[] getSortKeys()
+ {
+ return FlashCardColumns.SORT_KEYS;
+ }
+
+ /* (non-Javadoc)
+ * @see RowColumns#getValueAt(java.lang.Object, int)
+ */
+ public Object getValueAt(Object row, int columnIndex)
+ {
+ FlashCard flashCard = (FlashCard) row;
+ if (flashCard != null)
+ {
return flashCard.getSide(columnIndex == 0);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see FlashCardColumns#getTableName()
- */
- public String getTableName()
- {
- return FlashCardColumns.TABLE_NAME;
- }
-}
\ No newline at end of file
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see FlashCardColumns#getTableName()
+ */
+ public String getTableName()
+ {
+ return FlashCardColumns.TABLE_NAME;
+ }
+}
Modified: trunk/app/src/org/crosswire/flashcards/Lesson.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/Lesson.java 2004-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/src/org/crosswire/flashcards/Lesson.java 2004-10-31 02:47:29 UTC (rev 73)
@@ -6,7 +6,7 @@
* 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.
* The License is available on the internet at:
* http://www.gnu.org/copyleft/gpl.html,
@@ -14,30 +14,11 @@
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307, USA
- *
- * The copyright to this program is held by it's authors
- * Copyright: 2004
+ *
+ *
+ * Copyright: 2004 CrossWire Bible Society
*/
-/*
- * Distribution Licence:
- * FlashCard 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.
- * 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.
- * The License is available on the internet at:
- * http://www.gnu.org/copyleft/gpl.html,
- * or by writing to:
- * Free Software Foundation, Inc.
- * 59 Temple Place - Suite 330
- * Boston, MA 02111-1307, USA
- *
- * The copyright to this program is held by it's authors
- * Copyright: 2004
- */
+
package org.crosswire.flashcards;
import java.io.File;
@@ -48,284 +29,259 @@
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
+import java.net.URLConnection;
+import java.net.JarURLConnection;
-import org.crosswire.common.util.CWClassLoader;
-import org.crosswire.common.util.ResourceUtil;
-
/**
* A Lesson is an ordered list of FlashCards.
* The lesson also has a description which is useful for showing to a user.
- *
+ *
* @author Troy A. Griffitts [scribe at crosswire dot org]
* @author DM Smith [dmsmith555 at yahoo dot com]
*/
-public class Lesson implements Comparable
-{
- /**
- * Construct a new, empty lesson.
- * @param aFilename
- */
- public Lesson()
- {
- this("NewLesson.flash", "New Lesson");
- loaded = true;
- modified = true;
- }
+public class Lesson
+ implements Comparable {
- /**
- * Construct a lesson from file.
- * @param aFilename
- */
- public Lesson(String aFilename)
- {
- this(aFilename, null);
- }
+ /**
+ * The <code>filename</code> gives the relative location of the lesson.
+ * Typically this is something like lesson/setname/lessonname.flash.
+ */
+ private String url;
- /**
- * Construct a fully described, empty lesson.
- * @param aFilename
- * @param aDescription
- */
- public Lesson(String aFilename, String aDescription)
- {
- this.filename = aFilename;
- this.description = aDescription;
- flashCards = new TreeSet();
- }
+ /**
+ * A <code>description</code> of the lesson to be displayed to the user.
+ */
+ private String description;
- /**
- * Adds the specified <code>FlashCard</code> to this Lesson.
- *
- * @param flashCard to be added.
- */
- public void add(FlashCard flashCard)
- {
- load();
- flashCards.add(flashCard);
- }
+ /**
+ * A path to the <code>font</code> to be used by the lesson.
+ */
+ private String font;
- /**
- * Removes the specified <code>FlashCard</code> from the lesson.
- *
- * @param flashCard to be removed.
- */
- public void remove(FlashCard flashCard)
- {
- load();
- flashCards.remove(flashCard);
- }
+ /**
+ * An ordered list of <code>flashCards</code>
+ */
+ private Set flashCards = new TreeSet();
- /**
- * @param flashCard
- * @return
- */
- public boolean contains(FlashCard flashCard)
- {
- load();
- return flashCards.contains(flashCard);
- }
-
- /**
- * @return Returns the filename.
- */
- public String getFilename()
- {
- return filename;
- }
+ private boolean modified = false;
+ /**
+ * Construct a new, empty lesson.
+ */
+ public Lesson() {
+ this("NewLesson.flash", "New Lesson");
+ }
- /**
- * @param filename The filename to set.
- */
- public void setFilename(String filename)
- {
- this.filename = filename;
- }
- /**
- * @return Returns the description.
- */
- public String getDescription()
- {
- return description;
- }
+ /**
+ * Construct a lesson from URL.
+ * @param url
+ */
+ public Lesson(String url) {
+ this(url, null);
+ }
- /**
- * @param newDescription The description to set.
- */
- public void setDescription(String newDescription)
- {
- if (newDescription != null && !newDescription.equals(description))
- {
- modified = true;
- description = newDescription;
- }
- }
- /**
- * @return Returns the font.
- */
- public String getFont()
- {
- return font;
- }
+ /**
+ * Construct a lesson and assign a description
+ * @param url
+ * @param description
+ */
+ public Lesson(String url, String description) {
+ this.url = url;
+ load();
- /**
- * @param font The font to set.
- */
- public void setFont(String newFont)
- {
- if (newFont != null && !newFont.equals(font))
- {
- modified = true;
- font = newFont;
- }
- }
+ if (description != null) {
+ this.description = description;
+ }
+ }
- /**
- * @return Returns the flashCards.
- */
- public Iterator iterator()
- {
- load();
- return flashCards.iterator();
- }
- /**
- * @return whether this lesson has been modified
- */
- public boolean isModified()
- {
- if (modified)
- {
- return true;
- }
- Iterator iter = iterator();
- while (iter.hasNext())
- {
- FlashCard flashCard = (FlashCard) iter.next();
- if (flashCard.isModified())
- {
- return true;
- }
- }
- return false;
- }
+ /**
+ * Load this lesson from persistent store named by the lesson's <code>filename</code>.
+ */
+ public void load() {
+ try {
+ URL lessonURL = new URL(url);
+ Properties lesson = new Properties();
+ lesson.load(lessonURL.openConnection().getInputStream());
+ int wordCount = Integer.parseInt(lesson.getProperty("wordCount"));
+ description = lesson.getProperty("lessonTitle", url.substring(url.lastIndexOf('/') + 1));
+ for (int i = 0; i < wordCount; i++) {
+ add(new FlashCard(lesson.getProperty("word" + i), lesson.getProperty("answers" + i)));
+ }
+ modified = false;
+ }
+ catch (Exception e1) {
+ /* ignore it */
+ }
+ }
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(Object obj)
- {
- Lesson lesson = (Lesson) obj;
- return filename.compareTo(lesson.filename);
- }
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return description;
- }
+ /**
+ * Save this lesson to persistent store named by the lesson's <code>filename</code>.
+ */
+ public void store() {
+ Properties lesson = new Properties();
+ try {
+ lesson.setProperty("lessonTitle", description);
+ Iterator iter = flashCards.iterator();
+ int i = 0;
+ while (iter.hasNext()) {
+ FlashCard flashCard = (FlashCard) iter.next();
+ lesson.setProperty("word" + i, flashCard.getFront());
+ lesson.setProperty("answers" + i, flashCard.getBack());
+ i++;
+ }
+ lesson.setProperty("wordCount", Integer.toString(i));
- /**
- * Load this lesson from persistent store named by the lesson's <code>filename</code>.
- */
- public void load()
- {
- if (loaded)
- {
- return;
- }
+ // Save it as a "home" resource.
+ URL filePath = new URL(url);
+ File file = null;
+ URLConnection connection = filePath.openConnection();
+ if (connection instanceof JarURLConnection) {
+ file = new File(LessonManager.instance().getHomeProjectPath() + File.separator + ((JarURLConnection)connection).getEntryName());
+ }
+ else {
+ file = new File(filePath.getFile());
+ }
+ File dir = file.getParentFile();
+ // Is it already a directory ?
+ if (!dir.isDirectory()) {
+ dir.mkdirs();
+ }
+ lesson.store(new FileOutputStream(file), "Flash Lesson");
+ modified = false;
+ }
+ catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
- loaded = true;
- try
- {
- URL lessonURL = ResourceUtil.getResource(filename);
- Properties lesson = new Properties();
- lesson.load(lessonURL.openConnection().getInputStream());
- int wordCount = Integer.parseInt(lesson.getProperty("wordCount"));
- for (int i = 0; i < wordCount; i++)
- {
- add(new FlashCard(lesson.getProperty("word" + i), lesson.getProperty("answers" + i)));
- }
- }
- catch (Exception e1)
- {
- /* ignore it */;
- }
+ /**
+ * Adds the specified <code>FlashCard</code> to this Lesson.
+ *
+ * @param flashCard to be added.
+ */
+ public void add(FlashCard flashCard) {
+ flashCards.add(flashCard);
+ modified = true;
+ }
- }
- /**
- * Save this lesson to persistent store named by the lesson's <code>filename</code>.
- */
- public void store()
- {
- load();
- Properties lesson = new Properties();
- try
- {
- lesson.setProperty("lessonTitle", description);
- Iterator iter = flashCards.iterator();
- int i = 0;
- while (iter.hasNext())
- {
- FlashCard flashCard = (FlashCard) iter.next();
- lesson.setProperty("word" + i, flashCard.getFront());
- lesson.setProperty("answers" + i, flashCard.getBack());
- i++;
- }
- lesson.setProperty("wordCount", Integer.toString(i));
+ /**
+ * Removes the specified <code>FlashCard</code> from the lesson.
+ *
+ * @param flashCard to be removed.
+ */
+ public void remove(FlashCard flashCard) {
+ flashCards.remove(flashCard);
+ modified = true;
+ }
- // Save it as a "home" resource.
- URL filePath = CWClassLoader.getHomeResource(filename);
- File file = new File(filePath.getFile());
- File dir = file.getParentFile();
- // Is it already a directory ?
- if (!dir.isDirectory())
- {
- dir.mkdirs();
- }
- lesson.store(new FileOutputStream(file), "Flash Lesson");
- }
- catch (IOException ex)
- {
- ex.printStackTrace();
- }
- }
- /**
- * The <code>filename</code> gives the relative location of the lesson.
- * Typically this is something like lesson/setname/lessonname.flash.
- */
- private String filename;
+ /**
+ * @param flashCard
+ * @return
+ */
+ public boolean contains(FlashCard flashCard) {
+ return flashCards.contains(flashCard);
+ }
- /**
- * A <code>description</code> of the lesson to be displayed to the user.
- */
- private String description;
- /**
- * A path to the <code>font</code> to be used by the lesson.
- */
- private String font;
+ /**
+ * @return Returns the filename.
+ */
+ public String getURL() {
+ return url;
+ }
- /**
- * An ordered list of <code>flashCards</code>
- */
- private Set flashCards;
- /**
- * Flag indicating whether this lesson has been <code>modified</code>
- */
- private boolean modified;
-
- /**
- * Flag indicating whether this lesson has been <code>loaded</code>
- */
- private boolean loaded;
+ /**
+ * @param filename The filename to set.
+ */
+ public void setURL(String url) {
+ this.url = url;
+ modified = true;
+ }
-}
\ No newline at end of file
+
+ /**
+ * @return Returns the description.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+
+ /**
+ * @param newDescription The description to set.
+ */
+ public void setDescription(String newDescription) {
+ description = newDescription;
+ modified = true;
+ }
+
+
+ /**
+ * @return Returns the font.
+ */
+ public String getFont() {
+ return font;
+ }
+
+
+ /**
+ * @param newFont The font to set.
+ */
+ public void setFont(String newFont) {
+ font = newFont;
+ modified = true;
+ }
+
+
+ /**
+ * @return Returns the flashCards.
+ */
+ public Iterator iterator() {
+ return flashCards.iterator();
+ }
+
+
+ /**
+ * @return whether this lesson has been modified
+ */
+ public boolean isModified() {
+ if (modified) {
+ return true;
+ }
+
+ Iterator iter = iterator();
+ while (iter.hasNext()) {
+ FlashCard flashCard = (FlashCard) iter.next();
+ if (flashCard.isModified()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(Object obj) {
+ Lesson lesson = (Lesson) obj;
+ return url.compareTo(lesson.url);
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return description;
+ }
+
+}
Modified: trunk/app/src/org/crosswire/flashcards/LessonManager.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/LessonManager.java 2004-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/src/org/crosswire/flashcards/LessonManager.java 2004-10-31 02:47:29 UTC (rev 73)
@@ -15,17 +15,11 @@
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307, USA
*
- * The copyright to this program is held by it's authors
- * Copyright: 2004
+ * Copyright: 2004 CrossWire Bible Society
*/
package org.crosswire.flashcards;
import java.io.File;
-import java.io.IOException;
-import java.net.JarURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
@@ -33,8 +27,8 @@
import java.util.TreeSet;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
+import java.io.FilenameFilter;
-import org.crosswire.common.util.CWClassLoader;
/**
* The <code>LessonManager</code> provides the management of <code>LessonSet</code>s.
@@ -42,236 +36,181 @@
* @author Troy A. Griffitts [scribe at crosswire dot org]
* @author DM Smith [dmsmith555 at yahoo dot com]
*/
-public class LessonManager
-{
- public static LessonManager instance()
- {
- return INSTANCE;
- }
+public class LessonManager {
- private LessonManager()
- {
- lessonSets = new TreeSet();
- 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;
- }
- load();
- }
+ public static final String LESSON_ROOT = "lessons";
+ private static final String DIR_PROJECT = ".flashcards";
+ private static final LessonManager INSTANCE = new LessonManager();
- /**
- * @return the home directory url
- */
- public URL getHome()
- {
- return CWClassLoader.getHome();
- }
+ /**
+ * An ordered list of <code>lessonSets</code>
+ */
+ private Set lessonSets = new TreeSet();
+ private File homeLessonDir = null;
+ private String homeProjectPath = null;
- /**
- * Appends the specified <code>Lesson</code> to the end of this list.
- *
- * @param flashCard to be appended to this list.
- */
- public void add(LessonSet aLessonSet)
- {
- lessonSets.add(aLessonSet);
- }
+ public static LessonManager instance() {
+ return INSTANCE;
+ }
- /**
- * Load this lesson from persistent store named by the lesson's <code>LESSON_ROOT</code>.
- */
- public void load()
- {
- loadJarLessonSets();
- loadHomeLessonSets();
- }
- /**
- * Load lesson sets from the jar file
- */
- private void loadPathLessonSets()
- {
+ private LessonManager() {
+ try {
+ homeProjectPath = System.getProperty("user.home") + File.separator + DIR_PROJECT;
+ homeLessonDir = new File(homeProjectPath + File.separator + LESSON_ROOT);
+ }
+ catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ load();
+ }
- // Dig into the jar for lessonSets
- URL lessonsURL = this.getClass().getResource('/' + LESSON_ROOT);
- if (lessonsURL == null) {
- return;
- }
- URLConnection connection = null;
- try {
- connection = lessonsURL.openConnection();
- }
- catch (Exception e1) {
- assert false;
- }
- if (connection instanceof JarURLConnection) {
- JarURLConnection jarConnection = (JarURLConnection) connection;
- JarFile jarFile = null;
- try {
- jarFile = jarConnection.getJarFile();
- }
- catch (IOException e2) {
- assert false;
- }
- Enumeration entries = jarFile.entries();
- while (entries.hasMoreElements())
- {
- JarEntry jarEntry = (JarEntry) entries.nextElement();
- if (jarEntry.isDirectory())
- {
- String entryName = jarEntry.getName();
- // remove trailing '/'
- entryName = entryName.substring(0, entryName.length() - 1);
- if (entryName.startsWith(LESSON_ROOT) && ! entryName.equals(LESSON_ROOT))
- {
- // let the description be just the directory name and not the path
- add(new LessonSet(entryName));
+
+ /**
+ * Appends the specified <code>Lesson</code> to the end of this list.
+ *
+ * @param flashCard to be appended to this list.
+ */
+ public void add(LessonSet lessonSet) {
+ LessonSet exists = getLessonSet(lessonSet.getDescription());
+ if (exists == null) {
+ lessonSets.add(lessonSet);
+ }
+ else {
+ exists.augment(lessonSet);
+ }
+ }
+
+
+ public LessonSet getLessonSet(String description) {
+ Iterator i = iterator();
+ while (i.hasNext()) {
+ LessonSet ls = (LessonSet) i.next();
+ if (description.equals(ls.getDescription())) {
+ return ls;
+ }
+ }
+ return null;
+ }
+
+
+ /**
+ * Load this lesson from persistent store named by the lesson's <code>LESSON_ROOT</code>.
+ */
+ public void load() {
+ loadLessonSetsFromJarDir("./");
+ loadLessonSetsFromDir(homeLessonDir);
+ }
+
+
+ /**
+ * Load lesson sets from the jar file
+ */
+ private void loadLessonSetsFromJarDir(String path) {
+ File dir = new File(path);
+ if (dir.isDirectory()) {
+ File[] files = dir.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.toUpperCase().endsWith(".JAR");
}
- }
- }
- }
- }
- /**
- * Load lesson sets from the jar file
- */
- private void loadJarLessonSets()
- {
+ });
+ if (files != null) {
+ for (int i = 0; i < files.length; i++) {
+ loadJarLessonSets(files[i]);
+ }
+ }
+ }
+ }
- // Dig into the jar for lessonSets
- URL lessonsURL = this.getClass().getResource('/' + LESSON_ROOT);
- if (lessonsURL == null)
- {
- return;
- }
- URLConnection connection = null;
- try
- {
- connection = lessonsURL.openConnection();
- }
- catch (Exception e1)
- {
- assert false;
- }
- if (connection instanceof JarURLConnection)
- {
- JarURLConnection jarConnection = (JarURLConnection) connection;
- JarFile jarFile = null;
- try
- {
- jarFile = jarConnection.getJarFile();
- }
- catch (IOException e2)
- {
- assert false;
- }
- Enumeration entries = jarFile.entries();
- while (entries.hasMoreElements())
- {
- JarEntry jarEntry = (JarEntry) entries.nextElement();
- if (jarEntry.isDirectory())
- {
- String entryName = jarEntry.getName();
- // remove trailing '/'
- entryName = entryName.substring(0, entryName.length() - 1);
- if (entryName.startsWith(LESSON_ROOT) && ! entryName.equals(LESSON_ROOT))
- {
- // let the description be just the directory name and not the path
- add(new LessonSet(entryName));
+
+ /**
+ * Load lesson sets from the jar file
+ */
+ private void loadJarLessonSets(File jarFile) {
+
+ // Dig into the jar for lessonSets
+ JarFile jjarFile = null;
+ try {
+ jjarFile = new JarFile(jarFile);
+ Enumeration entries = jjarFile.entries();
+ while (entries.hasMoreElements()) {
+ JarEntry jarEntry = (JarEntry) entries.nextElement();
+ if (jarEntry.isDirectory()) {
+ String entryName = jarEntry.getName();
+ // remove trailing '/'
+ entryName = entryName.substring(0, entryName.length() - 1);
+ if (entryName.startsWith(LESSON_ROOT) && !entryName.equals(LESSON_ROOT)) {
+ // let the description be just the directory name and not the path
+ add(new LessonSet("jar:" + jarFile.getCanonicalFile().toURL().toString() + "!/" +
+ entryName));
+ }
}
- }
- }
- }
- }
+ }
+ }
+ catch (Exception e2) {
+ e2.printStackTrace();
+ }
+ }
- /**
- * Load lesson sets from the "home" directory
- */
- private void loadHomeLessonSets()
- {
- try
- {
- URL dirURL = CWClassLoader.getHomeResource(LESSON_ROOT);
- File directory = new File(dirURL.getFile());
- File[] files = directory.listFiles();
- if (files == null)
- {
- return;
- }
- Arrays.sort(files);
- for (int i = 0; i < files.length; i++)
- {
- File file = files[i];
- if (file.isDirectory())
- {
- // convert the path to one that is relative to the home and has forward slashes
- String lessonPath = file.getPath();
- // If it uses \ as a path separator then replace it w/ /
- lessonPath = lessonPath.replace('\\', '/');
- int offset = lessonPath.indexOf(LESSON_ROOT);
- lessonPath = lessonPath.substring(offset, lessonPath.length());
- // let the description be just the directory name and not the path
- add(new LessonSet(lessonPath));
- }
- }
- }
- catch (Exception e)
- {
- // that's fine. We just failed to load local files.
- }
- }
- /**
- * See if any LessonSet has changes that need to be saved
- */
- public boolean isModified()
- {
- Iterator iter = lessonSets.iterator();
- while (iter.hasNext())
- {
- LessonSet lessonSet = (LessonSet) iter.next();
- if (lessonSet.isModified())
- {
- return true;
- }
- }
- return false;
- }
+ /**
+ * Load lesson sets from the "home" directory
+ */
+ private void loadLessonSetsFromDir(File directory) {
+ try {
+ File[] files = directory.listFiles();
+ if (files == null) {
+ return;
+ }
+ Arrays.sort(files);
+ for (int i = 0; i < files.length; i++) {
+ File file = files[i];
+ if (file.isDirectory()) {
+ add(new LessonSet(files[i].toURL().toString()));
+ }
+ }
+ }
+ catch (Exception e) {
+ // that's fine. We just failed to load local files.
+ }
+ }
- /**
- * Save all the modified lesson sets to persistent store named by the lesson's <code>LESSON_ROOT</code>.
- */
- public void store()
- {
- Iterator iter = lessonSets.iterator();
- while (iter.hasNext())
- {
- LessonSet lessonSet = (LessonSet) iter.next();
- if (lessonSet.isModified())
- {
- lessonSet.store();
- }
- }
- }
- public Iterator iterator()
- {
- return lessonSets.iterator();
- }
+ /**
+ * See if any LessonSet has changes that need to be saved
+ */
+ public boolean isModified() {
+ Iterator iter = lessonSets.iterator();
+ while (iter.hasNext()) {
+ LessonSet lessonSet = (LessonSet) iter.next();
+ if (lessonSet.isModified()) {
+ return true;
+ }
+ }
+ return false;
+ }
- public static final String LESSON_ROOT = "lessons";
- private static final String DIR_PROJECT = ".flashcards";
- private static final String FILE_PROTOCOL = "file";
- private static final LessonManager INSTANCE = new LessonManager();
+ /**
+ * Save all the modified lesson sets to persistent store named by the lesson's <code>LESSON_ROOT</code>.
+ */
+ public void store() {
+ Iterator iter = lessonSets.iterator();
+ while (iter.hasNext()) {
+ LessonSet lessonSet = (LessonSet) iter.next();
+ if (lessonSet.isModified()) {
+ lessonSet.store();
+ }
+ }
+ }
- /**
- * An ordered list of <code>lessonSets</code>
- */
- private Set lessonSets;
+
+ public Iterator iterator() {
+ return lessonSets.iterator();
+ }
+
+
+ public String getHomeProjectPath() {
+ return homeProjectPath;
+ }
}
Modified: trunk/app/src/org/crosswire/flashcards/LessonSet.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/LessonSet.java 2004-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/src/org/crosswire/flashcards/LessonSet.java 2004-10-31 02:47:29 UTC (rev 73)
@@ -6,7 +6,7 @@
* 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.
* The License is available on the internet at:
* http://www.gnu.org/copyleft/gpl.html,
@@ -14,9 +14,8 @@
* Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307, USA
- *
- * The copyright to this program is held by it's authors
- * Copyright: 2004
+ *
+ * Copyright: 2004 CrossWire Bible Society
*/
package org.crosswire.flashcards;
@@ -34,9 +33,8 @@
import java.util.TreeSet;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
+import java.io.FilenameFilter;
-import org.crosswire.common.util.CWClassLoader;
-import org.crosswire.common.util.ResourceUtil;
/**
* A <code>LessonSet</code> is an ordered list of <code>Lesson</code>s.
@@ -44,266 +42,257 @@
* The lesson set also has a description which is useful for showing to a user
* and a directory name where its Lessons are stored. This directory name is expected to be a relative
* path and will be stored either in a jar or in the user's FlashCard directory.
- *
+ *
* @author Troy A. Griffitts [scribe at crosswire dot org]
* @author DM Smith [dmsmith555 at yahoo dot com]
*/
-public class LessonSet implements Comparable
-{
- public LessonSet(String aDirname)
- {
- dirname = aDirname; // .toLowerCase();
- description = dirname.substring(dirname.indexOf('/') + 1);
- lessons = new TreeSet();
- load();
- }
+public class LessonSet
+ implements Comparable {
- /**
- * Adds the specified <code>Lesson</code> to this lesson set.
- *
- * @param flashCard to be added.
- */
- public void add(Lesson lesson)
- {
- modified = true;
- lessons.add(lesson);
- }
+ /**
+ * The <code>url</code> of the lesson
+ */
+ private String url = null;
- /**
- * @return Returns the description.
- */
- public String getDescription()
- {
- return description;
- }
+ /**
+ * A <code>description</code> of the lesson to be displayed to the user.
+ */
+ private String description;
- /**
- * @param description The description to set.
- */
- public void setDescription(String newDescription)
- {
- if (newDescription != null && !newDescription.equals(description))
- {
- modified = true;
- description = newDescription;
- }
- }
+ /**
+ * An ordered list of <code>lessons</code>
+ */
+ private Set lessons = new TreeSet();
- /**
- * @return Returns the dirname.
- */
- public String getDirname()
- {
- return dirname;
- }
+ /**
+ * Flag indicating whether this lesson set has been <code>modified</code>
+ */
+ private boolean modified;
- public String getNextLessonFilename()
- {
- // This needs work: It should check for collisions
- String result = null;
- int next = lessons.size();
- Object [] params = { dirname, new Integer(next) };
- MessageFormat format = new MessageFormat("{0}/lesson{1,number,00}.flash");
- result = format.format(params);
- return result;
- }
+ public LessonSet(String url) {
+ this.url = url; // .toLowerCase();
+ description = url.substring(url.lastIndexOf('/', url.length() - 2) + 1);
+ if (description.endsWith("/")) {
+ description = description.substring(0, description.length() - 1);
+ }
+ load();
+ }
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(Object obj)
- {
- LessonSet lesson = (LessonSet) obj;
- return description.compareTo(lesson.description);
- }
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return description;
- }
+ /**
+ * Get the relative path names of the lessons in this lesson set from
+ * the jar file.
+ * @param lessonSet
+ */
- /**
- * Load this lesson set from persistent store named by the lesson set's <code>dirname</code>.
- * This is the union of lessons in the Jar and in the user's flashcard home directory.
- */
- public void load()
- {
- loadJarLessons();
- loadHomeLessons();
- }
- /**
- * Get the relative path names of the lessons in this lesson set from
- * the jar file.
- * @param lessonSet
- */
- private void loadJarLessons()
- {
+ /**
+ * Load this lesson set from persistent store named by the lesson set's <code>dirname</code>.
+ * This is the union of lessons in the Jar and in the user's flashcard home directory.
+ */
+ private void load() {
+ if (url == null) { // assert we have an URL
+ return;
+ }
- // Dig into the jar for lessons
- URL lessonsURL = this.getClass().getResource('/' + dirname);
- if (lessonsURL == null)
- {
- return;
- }
- URLConnection connection = null;
- try
- {
- connection = lessonsURL.openConnection();
- }
- catch (Exception e1)
- {
- assert false;
- }
- if (connection instanceof JarURLConnection)
- {
- JarURLConnection jarConnection = (JarURLConnection) connection;
- JarFile jarFile = null;
- try
- {
- jarFile = jarConnection.getJarFile();
- }
- catch (IOException e2)
- {
- assert false;
- }
- if (jarFile == null)
- {
- return;
- }
- Enumeration entries = jarFile.entries();
- while (entries.hasMoreElements())
- {
- JarEntry jarEntry = (JarEntry) entries.nextElement();
- String lessonPath = jarEntry.getName();
- if (lessonPath.startsWith(dirname) && !jarEntry.isDirectory())
- {
- String lessonDescription = getLessonDescription(lessonPath);
- lessons.add(new Lesson(lessonPath, lessonDescription));
- }
- }
- }
- }
+ URL lessonsURL = null;
+ URLConnection connection = null;
+ try {
+ lessonsURL = new URL(url);
+ if (lessonsURL == null) {
+ return;
+ }
+ connection = lessonsURL.openConnection();
+ }
+ catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ if (connection instanceof JarURLConnection) {
+ JarURLConnection jarConnection = (JarURLConnection) connection;
+ loadJarLessonSet(jarConnection);
+ }
+ else {
+ loadDirectoryLessonSet(new File(lessonsURL.getFile()));
+ }
+ }
- /**
- * Get the relative path names of the lessons in this lesson set from
- * the user's program home.
- * @param lessonSet
- */
- private void loadHomeLessons()
- {
- try
- {
- URL dirURL = CWClassLoader.getHomeResource(dirname);
- File directory = new File(dirURL.getFile());
- File[] files = directory.listFiles();
- if (files == null)
- {
- return;
- }
- Arrays.sort(files);
- for (int i = 0; i < files.length; i++)
- {
- // convert the path to one that is relative to the home and has forward slashes
- File file = files[i];
- String lessonPath = file.getPath();
- // If it uses \ as a path separator then replace it w/ /
- lessonPath = lessonPath.replace('\\', '/');
- int offset = lessonPath.indexOf(dirname);
- lessonPath = lessonPath.substring(offset, lessonPath.length());
- String lessonDescription = getLessonDescription(lessonPath);
- lessons.add(new Lesson(lessonPath, lessonDescription));
- }
- }
- catch (Exception e)
- {
- // that's fine. We just failed to load local files.
- }
- }
- /**
- * Get the description of the lesson
- * @param lessonpath the relative path to the lesson
- * @return the description of the lesson
- */
- private String getLessonDescription(String lessonpath)
- {
- URL lessonURL = ResourceUtil.getResource(lessonpath);
- Properties p = new Properties();
- try
- {
- p.load(lessonURL.openConnection().getInputStream());
- }
- catch (IOException ex)
- {
- assert false;
- }
- return p.getProperty("lessonTitle");
- }
+ private void loadJarLessonSet(JarURLConnection jarConnection) {
+ String dirName = jarConnection.getEntryName();
+ JarFile jarFile = null;
+ try {
+ jarFile = jarConnection.getJarFile();
+ }
+ catch (Exception e2) {
+ e2.printStackTrace();
+ }
+ if (jarFile == null) {
+ return;
+ }
+ Enumeration entries = jarFile.entries();
+ while (entries.hasMoreElements()) {
+ JarEntry jarEntry = (JarEntry) entries.nextElement();
+ String lessonPath = jarEntry.getName();
+ if (lessonPath.startsWith(dirName) && !jarEntry.isDirectory() &&
+ lessonPath.toUpperCase().endsWith(".FLASH")) {
+ lessons.add(new Lesson("jar:" + jarConnection.getJarFileURL() + "!/" + lessonPath));
+ }
+ }
+ }
- /**
- * Save this lesson to persistent store named by the lesson's <code>dirname</code>.
- */
- public void store()
- {
- Iterator iter = lessons.iterator();
- while (iter.hasNext())
- {
- Lesson lesson = (Lesson) iter.next();
- if (lesson.isModified())
- {
- lesson.store();
- }
- }
- }
- /**
- * @return whether the lesson set has been modified
- */
- public boolean isModified()
- {
- if (modified)
- {
- return true;
- }
+ /**
+ * Get the relative path names of the lessons in this lesson set from
+ * the user's program home.
+ * @param lessonSet
+ */
+ private void loadDirectoryLessonSet(File directory) {
+ try {
+ File[] files = directory.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.toUpperCase().endsWith(".FLASH");
+ }
+ });
+ if (files == null) {
+ return;
+ }
+ Arrays.sort(files);
+ for (int i = 0; i < files.length; i++) {
+ lessons.add(new Lesson(files[i].getCanonicalFile().toURL().toString()));
+ }
+ }
+ catch (Exception e) {
+ // that's fine. We just failed to load local files.
+ }
+ }
- Iterator iter = lessons.iterator();
- while (iter.hasNext())
- {
- Lesson lesson = (Lesson) iter.next();
- if (lesson.isModified())
- {
- return true;
- }
- }
- return false;
- }
- public Iterator iterator()
- {
- return lessons.iterator();
- }
+ /**
+ * Save this lesson to persistent store named by the lesson's <code>dirname</code>.
+ */
+ public void store() {
+ Iterator iter = lessons.iterator();
+ while (iter.hasNext()) {
+ Lesson lesson = (Lesson) iter.next();
+ if (lesson.isModified()) {
+ lesson.store();
+ }
+ }
+ }
- /**
- * The <code>dirname</code> of the lesson
- */
- private String dirname;
- /**
- * A <code>description</code> of the lesson to be displayed to the user.
- */
- private String description;
+ /**
+ * @return whether the lesson set has been modified
+ */
+ public boolean isModified() {
+ if (modified) {
+ return true;
+ }
- /**
- * An ordered list of <code>lessons</code>
- */
- private Set lessons;
+ Iterator iter = lessons.iterator();
+ while (iter.hasNext()) {
+ Lesson lesson = (Lesson) iter.next();
+ if (lesson.isModified()) {
+ return true;
+ }
+ }
+ return false;
+ }
- /**
- * Flag indicating whether this lesson set has been <code>modified</code>
- */
- private boolean modified;
+
+ public Iterator iterator() {
+ return lessons.iterator();
+ }
+
+
+ /**
+ * Adds the specified <code>Lesson</code> to this lesson set.
+ *
+ * @param flashCard to be added.
+ */
+ public void add(Lesson lesson) {
+ modified = true;
+ lessons.add(lesson);
+ }
+
+
+ /**
+ * @return Returns the description.
+ */
+ public String getDescription() {
+ return description;
+ }
+
+
+ /**
+ * @param description The description to set.
+ */
+ public void setDescription(String newDescription) {
+ if (newDescription != null && !newDescription.equals(description)) {
+ modified = true;
+ description = newDescription;
+ }
+ }
+
+
+ /**
+ * @return Returns the dirname.
+ */
+ public String getURL() {
+ return url;
+ }
+
+
+ public String getNextLessonFilename() {
+ // This needs work: It should check for collisions
+ String result = null;
+ int next = lessons.size();
+ Object[] params = {
+ url, new Integer(next)};
+ MessageFormat format = new MessageFormat("{0}/lesson{1,number,00}.flash");
+ result = format.format(params);
+ return result;
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(Object obj) {
+ LessonSet lesson = (LessonSet) obj;
+ return description.compareTo(lesson.description);
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return description;
+ }
+
+
+ public void augment(LessonSet other) {
+ Iterator i = other.iterator();
+ while (i.hasNext()) {
+ Lesson l = (Lesson) i.next();
+ Lesson exists = getLesson(l.getDescription());
+ if (exists != null) {
+ lessons.remove(exists);
+ }
+ lessons.add(l);
+ }
+ }
+
+
+ public Lesson getLesson(String description) {
+ Iterator i = iterator();
+ while (i.hasNext()) {
+ Lesson ls = (Lesson) i.next();
+ if (description.equals(ls.getDescription())) {
+ return ls;
+ }
+ }
+ return null;
+ }
}
Modified: trunk/app/src/org/crosswire/flashcards/SetupPane.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/SetupPane.java 2004-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/src/org/crosswire/flashcards/SetupPane.java 2004-10-31 02:47:29 UTC (rev 73)
@@ -31,12 +31,12 @@
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
-import org.crosswire.common.swing.FixedSplitPane;
+//import org.crosswire.common.swing.FixedSplitPane;
/**
* A panel used for setting up a quiz.
- *
+ *
* @author DM Smith [dmsmith555 at yahoo dot com]
*/
public class SetupPane extends JPanel
@@ -63,7 +63,7 @@
{
return flipped.isSelected();
}
-
+
public boolean isNoMultipleChoice()
{
return noMultipleChoice.isSelected();
@@ -118,7 +118,7 @@
}
});
- JSplitPane horizontalSplitPane = new FixedSplitPane();
+ JSplitPane horizontalSplitPane = new JSplitPane();
horizontalSplitPane.setResizeWeight(0.3D);
horizontalSplitPane.setDividerLocation(0.3D);
horizontalSplitPane.setRightComponent(lessonPanel);
Modified: trunk/app/src/org/crosswire/modedit/UniTextEdit.java
===================================================================
--- trunk/app/src/org/crosswire/modedit/UniTextEdit.java 2004-10-20 04:22:06 UTC (rev 72)
+++ trunk/app/src/org/crosswire/modedit/UniTextEdit.java 2004-10-31 02:47:29 UTC (rev 73)
@@ -399,6 +399,7 @@
public void setText(String text) {
jTextArea1.setText(text);
+ jTextArea1.repaint();
}
}
More information about the sword-cvs
mailing list