[jsword-svn] r972 -
trunk/jsword/src/main/java/org/crosswire/jsword/book/basic
dmsmith at crosswire.org
dmsmith at crosswire.org
Mon Jan 23 11:41:30 MST 2006
Author: dmsmith
Date: 2006-01-23 11:41:26 -0700 (Mon, 23 Jan 2006)
New Revision: 972
Modified:
trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBook.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/DefaultBookMetaData.java
Log:
new home for index
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBook.java 2006-01-23 18:22:44 UTC (rev 971)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBook.java 2006-01-23 18:41:26 UTC (rev 972)
@@ -21,7 +21,6 @@
*/
package org.crosswire.jsword.book.basic;
-import java.beans.PropertyChangeListener;
import java.util.Map;
import org.crosswire.common.activate.Lock;
@@ -31,7 +30,8 @@
import org.crosswire.jsword.book.BookException;
import org.crosswire.jsword.book.BookMetaData;
import org.crosswire.jsword.book.FeatureType;
-import org.crosswire.jsword.book.IndexStatus;
+import org.crosswire.jsword.book.index.IndexStatus;
+import org.crosswire.jsword.book.index.IndexStatusListener;
import org.crosswire.jsword.book.search.SearchRequest;
import org.crosswire.jsword.book.search.Searcher;
import org.crosswire.jsword.book.search.SearcherFactory;
@@ -245,19 +245,19 @@
}
/* (non-Javadoc)
- * @see org.crosswire.jsword.book.BookMetaData#removePropertyChangeListener(java.beans.PropertyChangeListener)
+ * @see org.crosswire.jsword.book.BookMetaData#removeIndexStatusListener(org.crosswire.jsword.book.index.IndexStatusListener)
*/
- public void removePropertyChangeListener(PropertyChangeListener li)
+ public void removeIndexStatusListener(IndexStatusListener li)
{
- bmd.removePropertyChangeListener(li);
+ bmd.removeIndexStatusListener(li);
}
/* (non-Javadoc)
- * @see org.crosswire.jsword.book.BookMetaData#addPropertyChangeListener(java.beans.PropertyChangeListener)
+ * @see org.crosswire.jsword.book.BookMetaData#addIndexStatusListener(org.crosswire.jsword.book.index.IndexStatusListener)
*/
- public void addPropertyChangeListener(PropertyChangeListener li)
+ public void addIndexStatusListener(IndexStatusListener li)
{
- bmd.addPropertyChangeListener(li);
+ bmd.addIndexStatusListener(li);
}
/* (non-Javadoc)
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java 2006-01-23 18:22:44 UTC (rev 971)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBookMetaData.java 2006-01-23 18:41:26 UTC (rev 972)
@@ -21,7 +21,6 @@
*/
package org.crosswire.jsword.book.basic;
-import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.LinkedHashMap;
import java.util.Locale;
@@ -37,7 +36,9 @@
import org.crosswire.jsword.book.BookDriver;
import org.crosswire.jsword.book.BookMetaData;
import org.crosswire.jsword.book.FeatureType;
-import org.crosswire.jsword.book.IndexStatus;
+import org.crosswire.jsword.book.index.IndexStatus;
+import org.crosswire.jsword.book.index.IndexStatusEvent;
+import org.crosswire.jsword.book.index.IndexStatusListener;
import org.jdom.Document;
/**
@@ -195,7 +196,7 @@
IndexStatus oldValue = this.indexStatus;
this.indexStatus = newValue;
prop.put(KEY_INDEXSTATUS, newValue);
- firePropertyChange(KEY_INDEXSTATUS, oldValue, newValue);
+ firePropertyChange(oldValue, newValue);
}
/* (non-Javadoc)
@@ -319,28 +320,28 @@
}
/* (non-Javadoc)
- * @see org.crosswire.jsword.book.BookMetaData#addPropertyChangeListener(java.beans.PropertyChangeListener)
+ * @see org.crosswire.jsword.book.BookMetaData#addIndexStatusListener(org.crosswire.jsword.book.index.IndexStatusListener)
*/
- public void addPropertyChangeListener(PropertyChangeListener listener)
+ public void addIndexStatusListener(IndexStatusListener listener)
{
if (listeners == null)
{
listeners = new EventListenerList();
}
- listeners.add(PropertyChangeListener.class, listener);
+ listeners.add(IndexStatusListener.class, listener);
}
/* (non-Javadoc)
- * @see org.crosswire.jsword.book.BookMetaData#removePropertyChangeListener(java.beans.PropertyChangeListener)
+ * @see org.crosswire.jsword.book.BookMetaData#removeIndexStatusListener(org.crosswire.jsword.book.index.IndexStatusListener)
*/
- public void removePropertyChangeListener(PropertyChangeListener listener)
+ public void removeIndexStatusListener(IndexStatusListener listener)
{
if (listeners == null)
{
return;
}
- listeners.remove(PropertyChangeListener.class, listener);
+ listeners.remove(IndexStatusListener.class, listener);
}
/**
@@ -348,16 +349,14 @@
* If <code>oldValue</code> and <code>newValue</code> are not equal and the
* <code>PropertyChangeEvent</code> listener list isn't empty,
* then fire a <code>PropertyChange</code> event to each listener.
- * @param propertyName the programmatic name of the property that was changed
- * @param oldValue the old value of the property (as an Object)
- * @param newValue the new value of the property (as an Object)
- * @see java.beans.PropertyChangeSupport
+ * @param oldStatus the old value of the property (as an Object)
+ * @param newStatus the new value of the property (as an Object)
*/
- protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
+ protected void firePropertyChange(IndexStatus oldStatus, IndexStatus newStatus)
{
if (listeners != null)
{
- if (oldValue != null && newValue != null && oldValue.equals(newValue))
+ if (oldStatus != null && newStatus != null && oldStatus.equals(newStatus))
{
return;
}
@@ -369,9 +368,9 @@
{
if (listenerList[i] == PropertyChangeListener.class)
{
- PropertyChangeEvent ev = new PropertyChangeEvent(this, propertyName, oldValue, newValue);
- PropertyChangeListener li = (PropertyChangeListener) listenerList[i + 1];
- li.propertyChange(ev);
+ IndexStatusEvent ev = new IndexStatusEvent(this, newStatus);
+ IndexStatusListener li = (IndexStatusListener) listenerList[i + 1];
+ li.statusChanged(ev);
}
}
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/DefaultBookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/DefaultBookMetaData.java 2006-01-23 18:22:44 UTC (rev 971)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/DefaultBookMetaData.java 2006-01-23 18:41:26 UTC (rev 972)
@@ -29,10 +29,10 @@
import org.crosswire.jsword.book.BookCategory;
import org.crosswire.jsword.book.BookDriver;
import org.crosswire.jsword.book.BookMetaData;
-import org.crosswire.jsword.book.IndexStatus;
import org.crosswire.jsword.book.OSISUtil;
-import org.crosswire.jsword.book.search.IndexManager;
-import org.crosswire.jsword.book.search.IndexManagerFactory;
+import org.crosswire.jsword.book.index.IndexManager;
+import org.crosswire.jsword.book.index.IndexManagerFactory;
+import org.crosswire.jsword.book.index.IndexStatus;
import org.jdom.Document;
import org.jdom.Element;
More information about the jsword-svn
mailing list