[jsword-svn] r1219 - in trunk: common/src/main/java/org/crosswire/common/progress jsword-limbo/src/main/java/org/crosswire/jsword/book/basic
dmsmith at www.crosswire.org
dmsmith at www.crosswire.org
Tue Dec 19 13:33:05 MST 2006
Author: dmsmith
Date: 2006-12-19 13:33:05 -0700 (Tue, 19 Dec 2006)
New Revision: 1219
Added:
trunk/common/src/main/java/org/crosswire/common/progress/Progress.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/VerifierMsg.java
trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/VerifierMsg.properties
Log:
Changed Job to implement Progress.
Added: trunk/common/src/main/java/org/crosswire/common/progress/Progress.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/progress/Progress.java (rev 0)
+++ trunk/common/src/main/java/org/crosswire/common/progress/Progress.java 2006-12-19 20:33:05 UTC (rev 1219)
@@ -0,0 +1,82 @@
+package org.crosswire.common.progress;
+
+public interface Progress
+{
+ /**
+ * Indicate that the total amount of work is unknown.
+ */
+ static int UNKNOWN = -1;
+
+ /**
+ * Start the task.
+ *
+ * @param name the initial name of the job.
+ * @param totalWork the total amount that is to be worked. If UNKNOWN then the progress is to be guessed.
+ */
+ void beginJob(String name, int totalWork);
+
+ /**
+ * @return the job name
+ */
+ String getJobName();
+
+ /**
+ * @return the total amount of work to be done
+ */
+ int getTotalWork();
+
+ /**
+ * Called to indicate that we are finished doing work.
+ */
+ void done();
+
+ /**
+ * We have moved onto another section so update the section title.
+ *
+ * @param name the name of the section
+ */
+ void setSectionName(String name);
+
+ /**
+ * We have moved onto another section so update the section title.
+ */
+ String getSectionName();
+
+ /**
+ * Indicate progress toward the whole.
+ *
+ * @param progress a part of the whole.
+ */
+ void setWork(int progress);
+
+ /**
+ * @return the amount of work done so far, possibly estimated
+ */
+ int getWork();
+
+ /**
+ * Cancel the job (if possible). If isCancelable() is false, then the job
+ * will be canceled if cancelable becomes true. There is no guarantee that
+ *
+ */
+ void cancel();
+
+ /**
+ * Used to determine whether job is done or cancelled or reached totalWork.
+ */
+ boolean isFinished();
+
+ /**
+ * Might the job be cancelable?
+ */
+ boolean isCancelable();
+
+ /**
+ * Indicates whether the job is cancelable or not.
+ *
+ * @param newCancelable The state to set.
+ */
+ void setCancelable(boolean newCancelable);
+
+
+}
Added: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/VerifierMsg.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/VerifierMsg.java (rev 0)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/VerifierMsg.java 2006-12-19 20:33:05 UTC (rev 1219)
@@ -0,0 +1,48 @@
+/**
+ * Distribution License:
+ * JSword is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License, version 2.1 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 Lesser General Public License for more details.
+ *
+ * The License is available on the internet at:
+ * http://www.gnu.org/copyleft/lgpl.html
+ * or by writing to:
+ * Free Software Foundation, Inc.
+ * 59 Temple Place - Suite 330
+ * Boston, MA 02111-1307, USA
+ *
+ * Copyright: 2005
+ * The copyright to this program is held by it's authors.
+ *
+ * ID: $Id: Msg.java 763 2005-07-27 19:26:43 -0400 (Wed, 27 Jul 2005) dmsmith $
+ */
+package org.crosswire.jsword.book.basic;
+
+import org.crosswire.common.util.MsgBase;
+
+/**
+ * Compile safe Msg resource settings.
+ *
+ * @see gnu.lgpl.License for license details.
+ * The copyright to this program is held by it's authors.
+ * @author Joe Walker [joe at eireneh dot com]
+ */
+public final class VerifierMsg extends MsgBase
+{
+ static final VerifierMsg VERIFY_START = new VerifierMsg("Verifier.Start"); //$NON-NLS-1$
+ static final VerifierMsg VERIFY_VERSES = new VerifierMsg("Verifier.Verses"); //$NON-NLS-1$
+ static final VerifierMsg VERIFY_VERSE = new VerifierMsg("Verifier.Verse"); //$NON-NLS-1$
+ static final VerifierMsg VERIFY_PASSAGES = new VerifierMsg("Verifier.Passages"); //$NON-NLS-1$
+ static final VerifierMsg VERIFY_WORD = new VerifierMsg("Verifier.Word"); //$NON-NLS-1$
+
+ /**
+ * Passthrough ctor
+ */
+ private VerifierMsg(String name)
+ {
+ super(name);
+ }
+}
Added: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/VerifierMsg.properties
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/VerifierMsg.properties (rev 0)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/VerifierMsg.properties 2006-12-19 20:33:05 UTC (rev 1219)
@@ -0,0 +1,12 @@
+# The naming convention for the keys in the file is ClassName.MessageName
+# Where ClassName is the name of the class using the property.
+# When the resource is used by more than one class it should be the one
+# that the resource is most closely associated.
+# The MessageName should be mixed case, with a leading capital.
+# It should have no spaces or other punctuation (e.g. _, -, ', ...)
+
+Verifier.Start=Copying Bible data to new driver
+Verifier.Verses=Checking Verses
+Verifier.Verse=Verse:
+Verifier.Passages=Checking Passages
+Verifier.Word=Word:
More information about the jsword-svn
mailing list