[jsword-svn] r1669 - in trunk: common-swing/src/main/java/org/crosswire/common/swing jsword/src/main/java/org/crosswire/jsword/util
dmsmith at www.crosswire.org
dmsmith at www.crosswire.org
Tue Aug 7 18:47:49 MST 2007
Author: dmsmith
Date: 2007-08-07 18:47:48 -0700 (Tue, 07 Aug 2007)
New Revision: 1669
Modified:
trunk/common-swing/src/main/java/org/crosswire/common/swing/CWScrollPane.java
trunk/jsword/src/main/java/org/crosswire/jsword/util/Project.java
Log:
fixed a Portable BD bug.
Modified: trunk/common-swing/src/main/java/org/crosswire/common/swing/CWScrollPane.java
===================================================================
--- trunk/common-swing/src/main/java/org/crosswire/common/swing/CWScrollPane.java 2007-08-08 00:19:25 UTC (rev 1668)
+++ trunk/common-swing/src/main/java/org/crosswire/common/swing/CWScrollPane.java 2007-08-08 01:47:48 UTC (rev 1669)
@@ -27,6 +27,8 @@
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
+import org.crosswire.common.util.OSType;
+
/**
* A ScrollPane that give appropriate cross platform behavior.
* Specifically, on the Mac the vertical and horizontal scrollbars should always appear.
@@ -51,20 +53,20 @@
private static int getXPlatformVerticalScrollBarPolicy()
{
-// if (OSType.MAC.equals(OSType.getOSType()))
-// {
+ if (OSType.MAC.equals(OSType.getOSType()))
+ {
return ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
-// }
-// return ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
+ }
+ return ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
}
private static int getXPlatformHorizontalScrollBarPolicy()
{
-// if (OSType.MAC.equals(OSType.getOSType()))
-// {
+ if (OSType.MAC.equals(OSType.getOSType()))
+ {
return ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
-// }
-// return ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
+ }
+ return ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
}
/* (non-Javadoc)
Modified: trunk/jsword/src/main/java/org/crosswire/jsword/util/Project.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/util/Project.java 2007-08-08 00:19:25 UTC (rev 1668)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/util/Project.java 2007-08-08 01:47:48 UTC (rev 1669)
@@ -24,7 +24,6 @@
import java.io.File;
import java.io.IOException;
import java.net.URI;
-import java.net.URISyntaxException;
import org.crosswire.common.util.CWClassLoader;
import org.crosswire.common.util.FileUtil;
@@ -50,7 +49,7 @@
* </p>
*
* <p>
- * Note: If the Java System property jsword.home is set and it exists and is writeable
+ * Note: If the Java System property jsword.home is set and it exists and is writable
* then it will be used instead of the above location. This is useful for USB Drives
* and other portable implementations of JSword. I is recommended that this name be JSword.
* </p>
@@ -129,16 +128,9 @@
String jswordhome = System.getProperty(PROPERTY_JSWORD_HOME);
if (jswordhome != null)
{
- try
+ home = NetUtil.getURI(new File(jswordhome));
+ if (!NetUtil.canWrite(home))
{
- home = new URI(NetUtil.PROTOCOL_FILE, null, jswordhome, null);
- if (!NetUtil.canWrite(home))
- {
- home = null;
- }
- }
- catch (URISyntaxException e)
- {
home = null;
}
}
@@ -196,8 +188,8 @@
}
/**
- * Get a the URI of a (potentially non-existant) properties file that we can
- * write to. This method of aquiring properties files is preferred over
+ * Get a the URI of a (potentially non-existent) properties file that we can
+ * write to. This method of acquiring properties files is preferred over
* getResourceProperties() as this is writable and can take into account
* user preferences.
* This method makes no promise that the URI returned is valid. It is
More information about the jsword-svn
mailing list