[jsword-svn] r2014 - in trunk: bibledesktop/src/main/java/org/crosswire/bibledesktop/book bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic bibledesktop/src/main/java/org/crosswire/bibledesktop/passage biblemapper/src/main/java/org/crosswire/biblemapper/swing common-swing/src/main/java/org/crosswire/common/config/swing common-swing/src/main/java/org/crosswire/common/progress/swing common-swing/src/main/java/org/crosswire/common/swing common-swing/src/main/java/org/crosswire/common/swing/desktop jsword/src/main/java/gnu/gpl jsword/src/main/java/gnu/lgpl jsword/src/main/java/org/crosswire/common/progress jsword/src/main/java/org/crosswire/common/util jsword/src/main/java/org/crosswire/jsword/book jsword/src/main/java/org/crosswire/jsword/book/filter/osis jsword/src/main/java/org/crosswire/jsword/book/filter/thml jsword/src/main/java/org/crosswire/jsword/book/install/sword jsword/src/main/java/org/crosswire/jsword/book/readings jsword/src/main/java/org/crosswire/jsword/book/study jsword/src/main/java/org/crosswire/jsword/book/sword jsword/src/main/java/org/crosswire/jsword/bridge jsword/src/main/java/org/crosswire/jsword/examples jsword/src/main/java/org/crosswire/jsword/index/lucene jsword/src/main/java/org/crosswire/jsword/index/query jsword/src/main/java/org/crosswire/jsword/passage jsword/src/main/java/org/crosswire/jsword/util jsword/src/main/java/org/crosswire/jsword/versification jsword/src/test/java jsword/src/test/java/org/crosswire/common/compress
dmsmith at crosswire.org
dmsmith at crosswire.org
Thu Nov 11 20:11:25 MST 2010
Author: dmsmith
Date: 2010-11-11 20:11:25 -0700 (Thu, 11 Nov 2010)
New Revision: 2014
Modified:
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/Msg.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitePane.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Msg.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/ActiveURITip.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/LazyHTMLEditorKit.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/Msg.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/TextPaneBookDataDisplay.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/URITipHelper.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/URITipMgr.java
trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/Msg.java
trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.java
trunk/common-swing/src/main/java/org/crosswire/common/config/swing/UserMsg.java
trunk/common-swing/src/main/java/org/crosswire/common/progress/swing/JobsProgressBar.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/CWOptionPane.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/LookAndFeelUtil.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/UserMsg.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/TDIViewLayout.java
trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/UserMsg.java
trunk/jsword/src/main/java/gnu/gpl/UserMsg.java
trunk/jsword/src/main/java/gnu/lgpl/Msg.java
trunk/jsword/src/main/java/org/crosswire/common/progress/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/common/util/Logger.java
trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java
trunk/jsword/src/main/java/org/crosswire/common/util/StackTrace.java
trunk/jsword/src/main/java/org/crosswire/common/util/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/BookCategory.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/DataPolice.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/osis/OSISFilter.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/THMLFilter.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/study/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookPath.java
trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BibleScope.java
trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java
trunk/jsword/src/main/java/org/crosswire/jsword/examples/BibleToOsis.java
trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/index/query/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/passage/RestrictionType.java
trunk/jsword/src/main/java/org/crosswire/jsword/passage/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/util/UserMsg.java
trunk/jsword/src/main/java/org/crosswire/jsword/versification/Msg.java
trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.java
trunk/jsword/src/main/java/org/crosswire/jsword/versification/UserMsg.java
trunk/jsword/src/test/java/Bench.java
trunk/jsword/src/test/java/org/crosswire/common/compress/LZSSTest.java
Log:
cleanup of checkstyle and findbugs reports and javadoc problems
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/Msg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/Msg.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/Msg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/Msg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,34 +38,31 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
/**
- * Get the internationalized text, but return key if key is unknown.
- * The text requires one parameter to be passed.
+ * Get the internationalized text, but return key if key is unknown. The
+ * text requires one parameter to be passed.
*
* @param key
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
/**
- * Get the internationalized text, but return key if key is unknown.
- * The text requires one parameter to be passed.
+ * Get the internationalized text, but return key if key is unknown. The
+ * text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitePane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitePane.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/install/SitePane.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -430,7 +430,7 @@
}
float size = installer.getSize(name) / 1024.0F;
-
+
String formattedMsg = "";
if (size > 1024.0F) {
size /= 1024.0F;
@@ -441,9 +441,7 @@
// to show one digit of fractional part.
// The , and . will automatically be converted into the user's proper separators.
formattedMsg = Msg.gettext("{0} is {1,number,###,###,###.#}MB. Continue?", new Object[] {name.getName(), new Float(size / 1024.0F)});
- }
- else
- {
+ } else {
// TRANSLATOR: The size of the book is provided so that the user can decide whether to continue a download.
// {0} is a placeholder for the name of the book.
// {1,number,###,###,###.#} is a placeholder for the size of the download in kilobytes.
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Msg.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Msg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Msg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -87,8 +87,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -100,8 +99,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -110,11 +108,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/ActiveURITip.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/ActiveURITip.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/ActiveURITip.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -36,6 +36,7 @@
import javax.swing.Popup;
import javax.swing.PopupFactory;
import javax.swing.border.TitledBorder;
+import javax.xml.transform.TransformerException;
import org.crosswire.bibledesktop.book.install.BookFont;
import org.crosswire.bibledesktop.desktop.Desktop;
@@ -53,11 +54,13 @@
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.BookCategory;
import org.crosswire.jsword.book.BookData;
+import org.crosswire.jsword.book.BookException;
import org.crosswire.jsword.book.BookMetaData;
import org.crosswire.jsword.book.Books;
import org.crosswire.jsword.book.Defaults;
import org.crosswire.jsword.passage.NoSuchKeyException;
import org.crosswire.jsword.util.ConverterFactory;
+import org.xml.sax.SAXException;
/**
* How it works: 1. When mouse clicked with the right button on a link, show the
@@ -69,17 +72,6 @@
*/
public class ActiveURITip extends MouseAdapter implements URIEventListener {
- JTextPane owner;
- LazyHTMLEditorKit lazykit;
- JTextPane txtView;
- JScrollPane scrView;
- TitledBorder title;
- Popup popup;
-
- int lastx, lasty, lastb;
-
- Converter converter;
-
public ActiveURITip(JTextPane own, Dimension dim) {
converter = ConverterFactory.getConverter();
owner = own;
@@ -135,7 +127,7 @@
return;
}
- assert (book == bdata.getFirstBook());
+ assert book == bdata.getFirstBook();
BookMetaData bmd = book.getBookMetaData();
if (bmd == null) {
@@ -173,18 +165,25 @@
/* Apply the fix if the text is too long and we are not Java 1.5 or greater */
if (txt.length() > 32768 && BookCategory.GENERAL_BOOK.equals(book.getBookCategory())) {
String javaVersion = System.getProperty("java.specification.version");
- if (javaVersion == null || "1.5".compareTo(javaVersion) > 0)
- {
+ if (javaVersion == null || "1.5".compareTo(javaVersion) > 0) {
txt = txt.substring(0, 32760) + "...";
}
}
-
- } catch (Exception e) {
- // SAXException, BookException, TransformerException
+ } catch (SAXException e) {
Reporter.informUser(this, e);
e.printStackTrace();
txtView.setText(e.getMessage());
title.setTitle("Exception");
+ } catch (TransformerException e) {
+ Reporter.informUser(this, e);
+ e.printStackTrace();
+ txtView.setText(e.getMessage());
+ title.setTitle("Exception");
+ } catch (BookException e) {
+ Reporter.informUser(this, e);
+ e.printStackTrace();
+ txtView.setText(e.getMessage());
+ title.setTitle("Exception");
}
// Set the correct direction
GuiUtil.applyOrientation(txtView, direction);
@@ -206,22 +205,24 @@
int horizDist = 30; // these numbers are hard coded
int vertiDist = 10; // but they depend on font size.
// always show tips in the 'better half'
- if (x + x > s.width)
+ if (x + x > s.width) {
x -= horizDist + d.width;
- else
+ } else {
x += horizDist;
- if (y + y > s.height)
+ }
+ if (y + y > s.height) {
y -= vertiDist + d.height;
- else
+ } else {
y += vertiDist;
-
+ }
popup = PopupFactory.getSharedInstance().getPopup(owner, scrView, x, y);
popup.show();
}
void hideTip() {
- if (popup != null)
+ if (popup != null) {
popup.hide();
+ }
popup = null;
}
@@ -232,14 +233,18 @@
boolean interested(URIEvent ev) {
// tell if it is interested in ev
String protocol = ev.getScheme();
- if (protocol.equals(Desktop.GREEK_DEF_PROTOCOL))
+ if (protocol.equals(Desktop.GREEK_DEF_PROTOCOL)) {
return true;
- if (protocol.equals(Desktop.HEBREW_DEF_PROTOCOL))
+ }
+ if (protocol.equals(Desktop.HEBREW_DEF_PROTOCOL)) {
return true;
- if (protocol.equals(Desktop.GREEK_MORPH_PROTOCOL))
+ }
+ if (protocol.equals(Desktop.GREEK_MORPH_PROTOCOL)) {
return true;
- if (protocol.equals(Desktop.HEBREW_MORPH_PROTOCOL))
+ }
+ if (protocol.equals(Desktop.HEBREW_MORPH_PROTOCOL)) {
return true;
+ }
return false;
}
@@ -248,7 +253,6 @@
*/
public void activateURI(URIEvent ev) {
// TODO Auto-generated method stub
-
}
/* (non-Javadoc)
@@ -283,4 +287,16 @@
// lazykit.getLinkCtrl().mouseClicked(e);
}
+ private JTextPane owner;
+ private LazyHTMLEditorKit lazykit;
+ private JTextPane txtView;
+ private JScrollPane scrView;
+ private TitledBorder title;
+ private Popup popup;
+
+ private int lastx;
+ private int lasty;
+ private int lastb;
+
+ private Converter converter;
}
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/LazyHTMLEditorKit.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/LazyHTMLEditorKit.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/LazyHTMLEditorKit.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -35,14 +35,6 @@
* @author Yingjie Lan [lanyjie at yahoo dot com]
*/
public class LazyHTMLEditorKit extends HTMLEditorKit {
-
- /**
- * Auto generated.
- */
- private static final long serialVersionUID = 4673477549981614993L;
- private HTMLEditorKit.LinkController linkCtrl = null;
-
-
/**
* Called when the kit is being installed into the
* a JEditorPane.
@@ -50,20 +42,20 @@
* @param c the JEditorPane
*/
public void install(JEditorPane c) {
- //c.addMouseListener(linkHandler);
- //c.addMouseMotionListener(linkHandler);
super.install(c);
MouseListener[] mls = c.getMouseListeners();
- for(int i=0; i<mls.length; i++)
- if (mls[i] instanceof HTMLEditorKit.LinkController){
- if (linkCtrl == null)
+ for (int i = 0; i < mls.length; i++) {
+ if (mls[i] instanceof HTMLEditorKit.LinkController) {
+ if (linkCtrl == null) {
linkCtrl = (HTMLEditorKit.LinkController) mls[i];
- else throw new RuntimeException("Multiple Link Controllers!");
+ } else {
+ throw new RuntimeException("Multiple Link Controllers!");
+ }
}
- //c.removeMouseListener(linkCtrl);
- c.removeMouseMotionListener(linkCtrl);
+ }
+ c.removeMouseMotionListener(linkCtrl);
}
-
+
/**
* Called when the kit is being removed from the
* JEditorPane. This is used to unregister any
@@ -73,13 +65,17 @@
*/
public void deinstall(JEditorPane c) {
c.addMouseMotionListener(linkCtrl);
- //c.addMouseListener(linkCtrl);
super.deinstall(c);
linkCtrl = null;
}
-
- public HTMLEditorKit.LinkController getLinkCtrl(){
+
+ public HTMLEditorKit.LinkController getLinkCtrl() {
return linkCtrl;
}
+ /**
+ * Auto generated.
+ */
+ private static final long serialVersionUID = 4673477549981614993L;
+ private HTMLEditorKit.LinkController linkCtrl;
}
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/Msg.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/Msg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/Msg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/TextPaneBookDataDisplay.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/TextPaneBookDataDisplay.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/TextPaneBookDataDisplay.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -90,10 +90,10 @@
styledDoc = txtView.getStyledDocument();
lastStart = -1;
lastLength = -1;
-
+
this.addURIEventListener(
new ActiveURITip(txtView,
- new Dimension(400,300)));
+ new Dimension(400, 300)));
}
/* (non-Javadoc)
@@ -179,8 +179,7 @@
/* Apply the fix if the text is too long and we are not Java 1.5 or greater */
if (text.length() > 32768 && BookCategory.GENERAL_BOOK.equals(getFirstBook().getBookCategory())) {
String javaVersion = System.getProperty("java.specification.version");
- if (javaVersion == null || "1.5".compareTo(javaVersion) > 0)
- {
+ if (javaVersion == null || "1.5".compareTo(javaVersion) > 0) {
text = text.substring(0, 32760) + "...";
}
}
@@ -453,7 +452,7 @@
/**
* To convert OSIS to HTML
*/
- Converter converter;
+ private Converter converter;
/**
* The display component
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/URITipHelper.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/URITipHelper.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/URITipHelper.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -30,6 +30,7 @@
import javax.swing.ToolTipManager;
import javax.swing.JToolTip;
import javax.swing.text.html.HTMLEditorKit;
+import javax.xml.transform.TransformerException;
import org.crosswire.bibledesktop.book.install.BookFont;
import org.crosswire.bibledesktop.desktop.Desktop;
@@ -47,10 +48,12 @@
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.BookCategory;
import org.crosswire.jsword.book.BookData;
+import org.crosswire.jsword.book.BookException;
import org.crosswire.jsword.book.BookMetaData;
import org.crosswire.jsword.book.Books;
import org.crosswire.jsword.book.Defaults;
import org.crosswire.jsword.passage.NoSuchKeyException;
+import org.xml.sax.SAXException;
/**
* Implement URIEventListener to receive URIEvents whenever someone activates an
@@ -61,25 +64,7 @@
* @author Yingjie Lan [lanyjie at yahoo dot com]
*/
public class URITipHelper implements URIEventListener {
-
- // int formerInitialDelay;
- int formerDismissDelay;
-
- // int myInitialDelay=2500;
- int myDismissDelay = 60000;
-
/**
- * The tool tip to help with.
- */
- FullHTMLTip tip;
-
- /**
- * The most recent interested event, which is used for content retrieving.
- */
- URIEvent event = null;
- private String txt = null;
-
- /**
* ctor: after creation, add this as a listener to a BookDataDisplay, for
* example: basic/TextPaneBookDataDisplay.java
*
@@ -107,10 +92,12 @@
* public String getToolTipText(){ return uritip.retrieve(); }
*/
public String retrieve(Converter converter) {
- if (event == null)
+ if (event == null) {
return null;
- if (txt != null)
+ }
+ if (txt != null) {
return txt; // return cached.
+ }
String protocol = event.getScheme();
Book book = null;
if (protocol.equals(Desktop.GREEK_DEF_PROTOCOL)) {
@@ -123,32 +110,34 @@
book = Defaults.getHebrewParse();
}
- if (book == null || Books.installed().getBook(book.getName()) == null)
- return txt = "Book Unavailable!";
+ if (book == null || Books.installed().getBook(book.getName()) == null) {
+ return "Book Unavailable!";
+ }
BookData bdata = null;
try {
bdata = new BookData(book, book.getKey(event.getURI()));
} catch (NoSuchKeyException ex) {
- return txt = ex.getDetailedMessage();
+ return ex.getDetailedMessage();
}
- assert (book == bdata.getFirstBook());
+ assert book == bdata.getFirstBook();
BookMetaData bmd = book.getBookMetaData();
- if (bmd == null)
- return txt = "Book Meta Data Unavailable!";
+ if (bmd == null) {
+ return "Book Meta Data Unavailable!";
+ }
// Make sure Hebrew displays from Right to Left
// Set the correct direction
boolean direction = bmd.isLeftToRight();
- GuiUtil.applyOrientation(tip.txtView, direction);
+ GuiUtil.applyOrientation(tip.getTextView(), direction);
// The content of the module determines how the display
// should behave. It should not be the user's locale.
// Set the correct locale
- tip.txtView.setLocale(new Locale(bmd.getLanguage().getCode()));
+ tip.getTextView().setLocale(new Locale(bmd.getLanguage().getCode()));
String fontSpec = GuiConvert.font2String(BookFont.instance().getFont(book));
try {
SAXEventProvider osissep = bdata.getSAXEventProvider();
@@ -176,32 +165,38 @@
/* Apply the fix if the text is too long and we are not Java 1.5 or greater */
if (txt.length() > 32768 && BookCategory.GENERAL_BOOK.equals(book.getBookCategory())) {
String javaVersion = System.getProperty("java.specification.version");
- if (javaVersion == null || "1.5".compareTo(javaVersion) > 0)
- {
+ if (javaVersion == null || "1.5".compareTo(javaVersion) > 0) {
txt = txt.substring(0, 32760) + "...";
}
}
- } catch (Exception e) {
- // SAXException, BookException, TransformerException
+ } catch (SAXException e) {
Reporter.informUser(this, e);
e.printStackTrace();
txt = e.getMessage();
+ } catch (TransformerException e) {
+ Reporter.informUser(this, e);
+ e.printStackTrace();
+ txt = e.getMessage();
+ } catch (BookException e) {
+ Reporter.informUser(this, e);
+ e.printStackTrace();
+ txt = e.getMessage();
}
return txt;
}
public String getTipTitle() {
- if (event == null)
+ if (event == null) {
return "Untitled Tip";
+ }
return event.getURI();
}
/**
* This method is called to indicate that an URI can be processed.
*
- * @param ev
- * Describes the URI
+ * @param ev Describes the URI
*/
public void activateURI(URIEvent ev) {
// if(!interested(ev)) return;
@@ -214,29 +209,15 @@
* Describes the URI
*/
public void enterURI(URIEvent ev) {
- if (!interested(ev))
+ if (!interested(ev)) {
return;
- // System.out.println("entering URI:"+ev.getURI());
-
+ }
// Get current delay
- // formerInitialDelay =
- // ToolTipManager.sharedInstance().getInitialDelay();
-
- // Show tool tips soon enough
- // ToolTipManager.sharedInstance().setInitialDelay(myInitialDelay);
-
- // Get current delay
formerDismissDelay = ToolTipManager.sharedInstance().getDismissDelay();
// Set delay longer enough
ToolTipManager.sharedInstance().setDismissDelay(myDismissDelay);
event = ev; // register event
- // if tip.getComponent(...) != null
- // if(tip!=null) tip.repaint();
-
- // Enable tool tips for the entire application
- // ToolTipManager.sharedInstance().setEnabled(true);
-
}
/**
@@ -247,17 +228,13 @@
*/
public void leaveURI(URIEvent ev) {
- if (!interested(ev))
+ if (!interested(ev)) {
return;
- // System.out.println("leaving URI:"+ev.getURI());
+ }
- // Disable tool tips for the entire application
- // ToolTipManager.sharedInstance().setEnabled(false);
- // ToolTipManager.sharedInstance().setInitialDelay(formerInitialDelay);
-
ToolTipManager.sharedInstance().setDismissDelay(formerDismissDelay);
- event = null;// clear event
+ event = null; // clear event
txt = null; // clear txt
}
@@ -268,25 +245,38 @@
boolean interested(URIEvent ev) {
// tell if it is interested in ev
String protocol = ev.getScheme();
- if (protocol.equals(Desktop.GREEK_DEF_PROTOCOL))
+ if (protocol.equals(Desktop.GREEK_DEF_PROTOCOL)) {
return true;
- if (protocol.equals(Desktop.HEBREW_DEF_PROTOCOL))
+ }
+ if (protocol.equals(Desktop.HEBREW_DEF_PROTOCOL)) {
return true;
- if (protocol.equals(Desktop.GREEK_MORPH_PROTOCOL))
+ }
+ if (protocol.equals(Desktop.GREEK_MORPH_PROTOCOL)) {
return true;
- if (protocol.equals(Desktop.HEBREW_MORPH_PROTOCOL))
+ }
+ if (protocol.equals(Desktop.HEBREW_MORPH_PROTOCOL)) {
return true;
+ }
return false;
}
-}
-class FullHTMLTip extends JToolTip {
+ private int formerDismissDelay;
+
+ private int myDismissDelay = 60000;
+
/**
- * randomly generated sid.
+ * The tool tip to help with.
*/
- private static final long serialVersionUID = 6364125062683029727L;
- JTextPane txtView = null;
+ private FullHTMLTip tip;
+ /**
+ * The most recent interested event, which is used for content retrieving.
+ */
+ private URIEvent event;
+ private String txt;
+}
+
+class FullHTMLTip extends JToolTip {
public FullHTMLTip() {
this.setLayout(new java.awt.CardLayout());
txtView = new AntiAliasedTextPane();
@@ -306,4 +296,17 @@
public void setTipText(String tipText) {
txtView.setText(tipText);
}
+
+ /**
+ * @return the text view
+ */
+ public JTextPane getTextView() {
+ return txtView;
+ }
+
+ /**
+ * randomly generated sid.
+ */
+ private static final long serialVersionUID = 6364125062683029727L;
+ private JTextPane txtView;
}
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/URITipMgr.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/URITipMgr.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/basic/URITipMgr.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -31,7 +31,6 @@
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
-import java.awt.event.MouseMotionListener;
import java.net.URI;
import java.util.Locale;
@@ -42,6 +41,7 @@
import javax.swing.Timer;
import javax.swing.border.TitledBorder;
import javax.swing.text.html.HTMLEditorKit;
+import javax.xml.transform.TransformerException;
import org.crosswire.bibledesktop.book.install.BookFont;
import org.crosswire.bibledesktop.desktop.Desktop;
@@ -59,11 +59,13 @@
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.BookCategory;
import org.crosswire.jsword.book.BookData;
+import org.crosswire.jsword.book.BookException;
import org.crosswire.jsword.book.BookMetaData;
import org.crosswire.jsword.book.Books;
import org.crosswire.jsword.book.Defaults;
import org.crosswire.jsword.passage.NoSuchKeyException;
import org.crosswire.jsword.util.ConverterFactory;
+import org.xml.sax.SAXException;
/**
* How it works:
@@ -80,20 +82,21 @@
* @author Yingjie Lan [lanyjie at yahoo dot com]
*/
public class URITipMgr extends MouseAdapter implements ActionListener, URIEventListener {
-
- Component owner;
- JTextPane txtView;
- JScrollPane scrView;
- TitledBorder title;
- Popup popup;
- boolean sticky;
- int lastx, lasty;
- URIEvent event;
- Timer timer;
+ private Component owner;
+ private JTextPane txtView;
+ private JScrollPane scrView;
+ private TitledBorder title;
+ private Popup popup;
+ private boolean sticky;
- Converter converter;
-
+ private int lastx;
+ private int lasty;
+ private URIEvent event;
+ private Timer timer;
+
+ private Converter converter;
+
public URITipMgr(Component own, Dimension dim) {
converter = ConverterFactory.getConverter();
owner = own;
@@ -112,15 +115,18 @@
txtView.addMouseListener(this);
setDelay(1500);
}
-
- public void setDelay(int delay){
- if(timer!=null) timer.stop();
+
+ public void setDelay(int delay) {
+ if (timer != null) {
+ timer.stop();
+ }
timer = new Timer(delay, this);
}
-
+
public void updateText() {
- if (event == null)
+ if (event == null) {
return;
+ }
String txt = null;
String protocol = event.getScheme();
Book book = null;
@@ -154,7 +160,7 @@
return;
}
- assert (book == bdata.getFirstBook());
+ assert book == bdata.getFirstBook();
BookMetaData bmd = book.getBookMetaData();
if (bmd == null) {
@@ -181,6 +187,7 @@
XSLTProperty.BASE_URL.setProperty(htmlsep);
XSLTProperty.DIRECTION.setProperty(htmlsep);
}
+
// Override the default if needed
htmlsep.setParameter(XSLTProperty.FONT.getName(), fontSpec);
@@ -197,14 +204,23 @@
txt = txt.substring(0, 32760) + "...";
}
}
-
- } catch (Exception e) {
- // SAXException, BookException, TransformerException
+ } catch (SAXException e) {
Reporter.informUser(this, e);
e.printStackTrace();
txtView.setText(e.getMessage());
title.setTitle("Exception");
+ } catch (TransformerException e) {
+ Reporter.informUser(this, e);
+ e.printStackTrace();
+ txtView.setText(e.getMessage());
+ title.setTitle("Exception");
+ } catch (BookException e) {
+ Reporter.informUser(this, e);
+ e.printStackTrace();
+ txtView.setText(e.getMessage());
+ title.setTitle("Exception");
}
+
// Set the correct direction
GuiUtil.applyOrientation(txtView, direction);
@@ -215,7 +231,7 @@
txtView.setText(txt);
txtView.setCaretPosition(0);
}
-
+
void showTip() {
// when it is time to do so
updateText();
@@ -227,19 +243,21 @@
int horizDist = 30; // these numbers are hard coded
int vertiDist = 10; // but they depend on font size.
// always show tips in the 'better half'
- if (x + x > s.width)
+ if (x + x > s.width) {
x -= horizDist + d.width;
- else
+ } else {
x += horizDist;
- if (y + y > s.height)
+ }
+ if (y + y > s.height) {
y -= vertiDist + d.height;
- else
+ } else {
y += vertiDist;
+ }
popup = PopupFactory.getSharedInstance().getPopup(owner, scrView, x, y);
popup.show();
}
-
+
void hideTip(boolean stick) {
if (popup != null) {
popup.hide();
@@ -247,11 +265,11 @@
popup = null;
sticky = stick;
}
-
+
/**
* @param ev if we are interested in this event
*/
- boolean interested(URIEvent ev){
+ boolean interested(URIEvent ev) {
//tell if it is interested in ev
String protocol = ev.getScheme();
if (protocol.equals(Desktop.GREEK_DEF_PROTOCOL)) {
@@ -287,8 +305,9 @@
if (sticky) {
hideTip(true); // remain sticky
showTip(); // new tip immediately
- } else
+ } else {
timer.start();
+ }
}
/* (non-Javadoc)
@@ -309,7 +328,7 @@
//A timer fires, time to show the tip.
//A tip might have been shown
hideTip(false); //unset sticky
- showTip();
+ showTip();
timer.stop();
}
@@ -318,7 +337,6 @@
*/
public void mouseDragged(MouseEvent e) {
// TODO Auto-generated method stub
-
}
/* (non-Javadoc)
@@ -328,7 +346,7 @@
lastx = e.getX();
lasty = e.getY();
}
-
+
public void mouseClicked(MouseEvent e) {
// System.out.println(e);
if (e.getSource() == txtView && e.getClickCount() == 1) {
Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/Msg.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/Msg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/passage/Msg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -31,25 +31,13 @@
* @author Joe Walker [joe at eireneh dot com]
*/
final class Msg extends MsgBase {
- static final Msg WHOLE_BIBLE = new Msg("The Whole Bible");
- static final Msg PART_BIBLE = new Msg("Search ({0})");
- static final Msg ERROR = new Msg("Error");
- static final Msg WHOLE = new Msg("The Bible");
-
/**
- * Passthrough ctor
- */
- private Msg(String name) {
- super(name);
- }
- /**
* Get the internationalized text, but return key if key is unknown.
*
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -61,8 +49,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -71,14 +58,12 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
private static MsgBase msg = new Msg();
- Msg() {}
}
Modified: trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.java
===================================================================
--- trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/Msg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -61,7 +61,7 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
public static String gettext(String key, Object[] params)
Modified: trunk/common-swing/src/main/java/org/crosswire/common/config/swing/UserMsg.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/config/swing/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/common-swing/src/main/java/org/crosswire/common/config/swing/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/progress/swing/JobsProgressBar.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/progress/swing/JobsProgressBar.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/common-swing/src/main/java/org/crosswire/common/progress/swing/JobsProgressBar.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -368,7 +368,8 @@
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridwidth = 1;
gbc.fill = GridBagConstraints.NONE;
- panel.add(bar.createCancelButton(job), gbc);
+ cancelButton = bar.createCancelButton(job);
+ panel.add(cancelButton, gbc);
gbc.weightx = 1.0;
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.fill = GridBagConstraints.HORIZONTAL;
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/CWOptionPane.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/CWOptionPane.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/CWOptionPane.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -775,11 +775,10 @@
/**
* The actions for this dialog.
*/
- /* protected */static ActionFactory actions = new ActionFactory(CWOptionPane.class, null);
+ private static ActionFactory actions = new ActionFactory(CWOptionPane.class, null);
/**
* Serialization ID
*/
private static final long serialVersionUID = -1870422750863765033L;
-
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/LookAndFeelUtil.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/LookAndFeelUtil.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/LookAndFeelUtil.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -154,10 +154,8 @@
try {
// Note: GTK looks good under Java 1.5, but is broken.
// Motif still does not look good.
- if (systemLAF.indexOf("WindowsLookAndFeel") != -1 ||
- //systemLAF.indexOf("GTKLookAndFeel") != -1 ||
- systemLAF.indexOf("AquaLookAndfeel") != -1)
- {
+ // systemLAF.indexOf("GTKLookAndFeel") != -1 ||
+ if (systemLAF.indexOf("WindowsLookAndFeel") != -1 || systemLAF.indexOf("AquaLookAndfeel") != -1) {
UIManager.setLookAndFeel(systemLAF);
// MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
// UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/UserMsg.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/TDIViewLayout.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/TDIViewLayout.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/TDIViewLayout.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -46,8 +46,7 @@
public TDIViewLayout() {
super();
tabs = new JTabbedPane();
- if (UIManager.getDefaults().containsKey("BibleViewPane.TabbedPaneUI"))
- {
+ if (UIManager.getDefaults().containsKey("BibleViewPane.TabbedPaneUI")) {
tabs.setUI((TabbedPaneUI) UIManager.get("BibleViewPane.TabbedPaneUI"));
}
tabs.setMinimumSize(new Dimension(0, 0));
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/UserMsg.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/desktop/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/gnu/gpl/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/gnu/gpl/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/gnu/gpl/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/gnu/lgpl/Msg.java
===================================================================
--- trunk/jsword/src/main/java/gnu/lgpl/Msg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/gnu/lgpl/Msg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -37,8 +37,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -50,8 +49,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -60,11 +58,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/common/progress/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/progress/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/common/progress/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/common/util/Logger.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/Logger.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/Logger.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -213,7 +213,7 @@
}
/**
- * Create a logger for the class. Wrapped by {@link getLogger}.
+ * Create a logger for the class. Wrapped by {@link #java.util.logging.Logger.getLogger(String)}.
*/
private Logger(Class id, boolean showLocation) {
this.logger = java.util.logging.Logger.getLogger(id.getName());
Modified: trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/MsgBase.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -49,8 +49,7 @@
this.name = name;
}
- protected MsgBase()
- {
+ protected MsgBase() {
this.shaper = new NumberShaper();
loadResources();
}
@@ -61,9 +60,8 @@
* @param key
* @return the internationalized text
*/
- public String lookup(String key)
- {
- return shaper.shape(obtainString(key));
+ public String lookup(String key) {
+ return shaper.shape(obtainString(key));
}
/**
Modified: trunk/jsword/src/main/java/org/crosswire/common/util/StackTrace.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/StackTrace.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/StackTrace.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -72,8 +72,7 @@
for (int i = 0; i < calls.length - discard; i++) {
String call = calls[i + discard];
- if (!(call.startsWith("Caused") || call.indexOf("...") >= 0))
- {
+ if (!(call.startsWith("Caused") || call.indexOf("...") >= 0)) {
total++;
}
}
@@ -88,8 +87,7 @@
String call = calls[i + discard];
try {
- if (!(call.startsWith("Caused") || call.indexOf("...") >= 0))
- {
+ if (!(call.startsWith("Caused") || call.indexOf("...") >= 0)) {
int spcIndex = call.indexOf(' ');
int lhsIndex = call.indexOf('(');
int clnIndex = call.indexOf(':');
Modified: trunk/jsword/src/main/java/org/crosswire/common/util/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/BookCategory.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/BookCategory.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/BookCategory.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -71,7 +71,7 @@
*/
private BookCategory(String name, String externalName) {
this.name = name;
- this.externalName = externalName.toString();
+ this.externalName = externalName;
}
/**
@@ -93,7 +93,7 @@
public static BookCategory fromExternalString(String name) {
for (int i = 0; i < VALUES.length; i++) {
BookCategory o = VALUES[i];
- if (o.externalName.toString().equalsIgnoreCase(name)) {
+ if (o.externalName.equalsIgnoreCase(name)) {
return o;
}
}
@@ -148,7 +148,7 @@
* @see java.lang.Object#toString()
*/
public String toString() {
- return externalName.toString();
+ return externalName;
}
/**
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/DataPolice.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/DataPolice.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/DataPolice.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -63,21 +63,21 @@
* Set the current level at which to report problems. Problems at too fine
* grain a level might be filtered by default.
*
- * @param level
+ * @param lev
* the level to set
*/
- public static void setReportingLevel(Level level) {
- DataPolice.level = level;
+ public static void setReportingLevel(Level lev) {
+ DataPolice.level = lev;
}
/**
* Set the level at which to show problems.
*
- * @param level
+ * @param lev
* the level to set
*/
- public static void setLevel(Level level) {
- log.setLevel(level);
+ public static void setLevel(Level lev) {
+ log.setLevel(lev);
}
/**
@@ -108,8 +108,6 @@
/**
* Report a message against the current book and key.
*
- * @param lev
- * the level at which to report
* @param message
* the police report.
*/
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -39,8 +39,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -52,8 +51,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -62,11 +60,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/osis/OSISFilter.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/osis/OSISFilter.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/osis/OSISFilter.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -61,8 +61,7 @@
// FIXME(dms): this is a major HACK handling a problem with a badly
// encoded module.
- if (book.getInitials().startsWith("NET") && plain.endsWith("</div>"))
- {
+ if (book.getInitials().startsWith("NET") && plain.endsWith("</div>")) {
clean = clean.substring(0, plain.length() - 6);
}
@@ -90,8 +89,7 @@
}
if (ex != null) {
- DataPolice.report("Parse " + book.getInitials() + "(" + key.getName() + ") failed: " + ex.getMessage() +
- "\non: " + plain);
+ DataPolice.report("Parse " + book.getInitials() + "(" + key.getName() + ") failed: " + ex.getMessage() + "\non: " + plain);
ele = cleanTags(book, key, clean);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/THMLFilter.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/THMLFilter.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/thml/THMLFilter.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -76,8 +76,8 @@
int start = Math.max(0, colNumber - 40);
int stop = Math.min(finalInput.length(), colNumber + 40);
int here = stop - start;
- log.warn("Could not fix " + book.getInitials() + '(' + key.getName() + ") by " +
- errorMessage + ": Error here(" + colNumber + ',' + finalInput.length() + ',' + here + "): " + finalInput.substring(start, stop));
+ log.warn("Could not fix " + book.getInitials() + '(' + key.getName() + ") by "
+ + errorMessage + ": Error here(" + colNumber + ',' + finalInput.length() + ',' + here + "): " + finalInput.substring(start, stop));
} else {
log.warn("Could not fix " + book.getInitials() + "(" + key.getName() + ") by " + errorMessage + ": " + error.getMessage());
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/study/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/study/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/study/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -598,10 +598,10 @@
// At least one of the two languages should match the lang entry
if (!langFrom.equals(lang) && !langTo.equals(lang)) {
- log.error("Data error in " + internal +
- ". Neither " + ConfigEntryType.GLOSSARY_FROM.getName() +
- " or " + ConfigEntryType.GLOSSARY_FROM.getName() +
- " match " + ConfigEntryType.LANG.getName());
+ log.error("Data error in " + internal
+ + ". Neither " + ConfigEntryType.GLOSSARY_FROM.getName()
+ + " or " + ConfigEntryType.GLOSSARY_FROM.getName()
+ + " match " + ConfigEntryType.LANG.getName());
} else if (!langFrom.equals(lang)) {
// The LANG field should match the GLOSSARY_FROM field
/*
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookPath.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookPath.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookPath.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -161,8 +161,7 @@
testDefaultPath(bookDirs, swordhome + File.separator + ".." + File.separator + DIR_SWORD_LIBRARY);
}
- if (System.getProperty("os.name").startsWith("Windows"))
- {
+ if (System.getProperty("os.name").startsWith("Windows")) {
testDefaultPath(bookDirs, DIR_WINDOWS_DEFAULT);
// how about in the library, just next door?
testDefaultPath(bookDirs, DIR_WINDOWS_DEFAULT + File.separator + ".." + File.separator + DIR_SWORD_LIBRARY);
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BibleScope.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BibleScope.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BibleScope.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -93,7 +93,7 @@
BibleInfo.setFullBookName(false); // use short names
System.out.println('[' + b.getInitials() + ']');
System.out.println("InScope=" + scope.getInScope().getOsisRef());
- System.out.println("OutScope=" + scope.getOutOfScope().getOsisRef());
+ System.out.println("OutScope=" + scope.getOutOfScope().getOsisRef());
}
private Book book;
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -346,6 +346,7 @@
Map.Entry mapEntry = (Map.Entry) iter.next();
name = (String) mapEntry.getKey();
installer = (Installer) mapEntry.getValue();
+ System.out.println(name + ": " + installer.getInstallerDefinition());
}
name = "CrossWire";
@@ -362,10 +363,15 @@
// Get a list of all the available books
List availableBooks = installer.getBooks();
+ Book book = (Book) availableBooks.get(0);
+ if (book != null) {
+ System.out.println("Book " + book.getInitials() + " is available");
+ }
+
// get some available books. In this case, just one book.
availableBooks = installer.getBooks(new MyBookFilter("ESV"));
- Book book = (Book) availableBooks.get(0);
+ book = (Book) availableBooks.get(0);
if (book != null) {
System.out.println("Book " + book.getInitials() + " is available");
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/examples/BibleToOsis.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/examples/BibleToOsis.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/examples/BibleToOsis.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -227,11 +227,11 @@
private void buildChapterOpen(StringBuffer buf, String bookName, int chapter) {
MessageFormat msgFormat = new MessageFormat("<chapter osisID=\"{0}.{1}\" chapterTitle=\"{2} {1}.\">\n");
- if ("Obad".equals(bookName) ||
- "Phlm".equals(bookName) ||
- "2John".equals(bookName) ||
- "3John".equals(bookName) ||
- "Jude".equals(bookName))
+ if ("Obad".equals(bookName)
+ || "Phlm".equals(bookName)
+ || "2John".equals(bookName)
+ || "3John".equals(bookName)
+ || "Jude".equals(bookName))
{
return;
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/index/query/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/index/query/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/index/query/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/RestrictionType.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/RestrictionType.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/RestrictionType.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -337,16 +337,13 @@
* @return The current default blurRestriction setting
*/
public static RestrictionType getDefaultBlurRestriction() {
- if (defaultBlurRestriction == null) {
- defaultBlurRestriction = RestrictionType.NONE;
- }
return defaultBlurRestriction;
}
/**
* A default restriction type for blurring.
*/
- private static RestrictionType defaultBlurRestriction;
+ private static RestrictionType defaultBlurRestriction = RestrictionType.NONE;
/**
* The name of the RestrictionType
@@ -362,7 +359,7 @@
}
private static final RestrictionType[] VALUES = {
- NONE, CHAPTER,
+ NONE, CHAPTER
};
/**
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/util/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/util/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/util/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -39,8 +39,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -52,8 +51,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -62,11 +60,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/Msg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/Msg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/Msg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -49,8 +49,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -62,8 +61,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -72,14 +70,14 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
private static MsgBase msg = new Msg();
- Msg() {}
+ public Msg() {
+ }
}
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/SectionNames.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -216,7 +216,7 @@
*/
private void initialize() {
sections = new String[SECTIONS_IN_BIBLE];
-
+
// TRANSLATOR: Pentateuch is the first 5 books of the Bible.
sections[0] = UserMsg.gettext("Pentateuch");
// TRANSLATOR: History are the books of the Old Testament that give the history of Israel
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/versification/UserMsg.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/versification/UserMsg.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/versification/UserMsg.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -38,8 +38,7 @@
* @param key
* @return the internationalized text
*/
- public static String gettext(String key)
- {
+ public static String gettext(String key) {
return msg.lookup(key);
}
@@ -51,8 +50,7 @@
* @param param
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object param)
- {
+ public static String gettext(String key, Object param) {
return msg.toString(key, param);
}
@@ -61,11 +59,10 @@
* The text requires one parameter to be passed.
*
* @param key
- * @param param
+ * @param params
* @return the formatted, internationalized text
*/
- public static String gettext(String key, Object[] params)
- {
+ public static String gettext(String key, Object[] params) {
return msg.toString(key, params);
}
Modified: trunk/jsword/src/test/java/Bench.java
===================================================================
--- trunk/jsword/src/test/java/Bench.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/test/java/Bench.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -32,7 +32,7 @@
Speed speed = new Speed(version);
speed.run();
- float time = speed.getBenchmark() / 1000;
+ double time = speed.getBenchmark() / 1000.0;
System.out.println("CBench mark for '" + args[0] + "': " + time + "s");
}
Modified: trunk/jsword/src/test/java/org/crosswire/common/compress/LZSSTest.java
===================================================================
--- trunk/jsword/src/test/java/org/crosswire/common/compress/LZSSTest.java 2010-11-11 23:33:45 UTC (rev 2013)
+++ trunk/jsword/src/test/java/org/crosswire/common/compress/LZSSTest.java 2010-11-12 03:11:25 UTC (rev 2014)
@@ -40,7 +40,7 @@
* @author DM Smith [dmsmith555 at yahoo dot com]
*/
public class LZSSTest extends TestCase {
- public static int RING_SIZE = 4096;
+ public static final int RING_SIZE = 4096;
public static int RING_WRAP = RING_SIZE - 1;
public static int THRESHOLD = 3;
More information about the jsword-svn
mailing list