[jsword-svn] r1145 - in trunk/bibledesktop/src/main: java/org/crosswire/bibledesktop/desktop resources/xsl/cswing

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Mon Oct 9 19:36:15 MST 2006


Author: dmsmith
Date: 2006-10-09 19:36:02 -0700 (Mon, 09 Oct 2006)
New Revision: 1145

Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.properties
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_de.properties
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/XSLTProperty.java
   trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl
Log:
Added the ability to show and hide headings.

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java	2006-10-09 21:15:43 UTC (rev 1144)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.java	2006-10-10 02:36:02 UTC (rev 1145)
@@ -462,6 +462,9 @@
         verseMenu.add(radio).addMouseListener(barStatus);
 
         menuView.addSeparator();
+        toggle = new JCheckBoxMenuItem(actions.getAction(XSLTProperty.HEADINGS.getName()));
+        toggle.setSelected(XSLTProperty.HEADINGS.getDefault());
+        menuView.add(toggle).addMouseListener(barStatus);
         toggle = new JCheckBoxMenuItem(actions.getAction(XSLTProperty.NOTES.getName()));
         toggle.setSelected(XSLTProperty.NOTES.getDefault());
         menuView.add(toggle).addMouseListener(barStatus);

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.properties
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.properties	2006-10-09 21:15:43 UTC (rev 1144)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop.properties	2006-10-10 02:36:02 UTC (rev 1145)
@@ -323,6 +323,15 @@
 TinyVNum.AcceleratorKey=
 TinyVNum.AcceleratorKey.Modifiers=
 
+Headings.Name=Show Headings
+Headings.ShortDescription=Show Headings
+Headings.LongDescription=Show Headings
+Headings.SmallIcon=
+Headings.LargeIcon=
+Headings.MnemonicKey=
+Headings.AcceleratorKey=
+Headings.AcceleratorKey.Modifiers=
+
 Notes.Name=Show Study Notes
 Notes.ShortDescription=Show Study Notes
 Notes.LongDescription=Show Study Notes

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java	2006-10-09 21:15:43 UTC (rev 1144)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/DesktopActions.java	2006-10-10 02:36:02 UTC (rev 1145)
@@ -314,6 +314,15 @@
         da.getBookDataDisplay().refresh();
     }
 
+    public void doHeadings(ActionEvent ev)
+    {
+        JCheckBoxMenuItem toggle = (JCheckBoxMenuItem) ev.getSource();
+        XSLTProperty.HEADINGS.setState(toggle.isSelected());
+        BibleViewPane view = (BibleViewPane) getDesktop().getViews().getSelected();
+        SplitBookDataDisplay da = view.getPassagePane();
+        da.getBookDataDisplay().refresh();
+    }
+
     public void doNotes(ActionEvent ev)
     {
         JCheckBoxMenuItem toggle = (JCheckBoxMenuItem) ev.getSource();

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_de.properties
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_de.properties	2006-10-09 21:15:43 UTC (rev 1144)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/Desktop_de.properties	2006-10-10 02:36:02 UTC (rev 1145)
@@ -222,6 +222,15 @@
 TinyVNum.AcceleratorKey=
 TinyVNum.AcceleratorKey.Modifiers=
 
+Headings.Name=Show Headings
+Headings.ShortDescription=Show Headings
+Headings.LongDescription=Show Headings
+Headings.SmallIcon=
+Headings.LargeIcon=
+Headings.MnemonicKey=
+Headings.AcceleratorKey=
+Headings.AcceleratorKey.Modifiers=
+
 Notes.Name=Zeige Studier-Notizen
 Notes.ShortDescription=Zeige Studier-Notizen
 Notes.LongDescription=Zeige Studier-Notizen

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/XSLTProperty.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/XSLTProperty.java	2006-10-09 21:15:43 UTC (rev 1144)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/XSLTProperty.java	2006-10-10 02:36:02 UTC (rev 1145)
@@ -77,6 +77,11 @@
     public static final XSLTProperty TINY_VERSE_NUMBERS = new XSLTProperty("TinyVNum", true); //$NON-NLS-1$
 
     /**
+     * Should headings be shown
+     */
+    public static final XSLTProperty HEADINGS = new XSLTProperty("Headings", true); //$NON-NLS-1$
+
+    /**
      * Should notes be shown
      */
     public static final XSLTProperty NOTES = new XSLTProperty("Notes", true); //$NON-NLS-1$
@@ -217,6 +222,7 @@
         BCV,
         NO_VERSE_NUMBERS,
         TINY_VERSE_NUMBERS,
+        HEADINGS,
         NOTES,
         XREF,
     };

Modified: trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl
===================================================================
--- trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl	2006-10-09 21:15:43 UTC (rev 1144)
+++ trunk/bibledesktop/src/main/resources/xsl/cswing/simple.xsl	2006-10-10 02:36:02 UTC (rev 1145)
@@ -57,9 +57,6 @@
   <!-- The absolute base for relative references. -->
   <xsl:param name="baseURL" select="''"/>
 
-  <!-- Whether to show non-canonical "headings" or not -->
-  <xsl:param name="Headings" select="'true'"/>
-
   <!-- Whether to show Strongs or not -->
   <xsl:param name="Strongs" select="'false'"/>
 
@@ -69,6 +66,9 @@
   <!-- Whether to start each verse on an new line or not -->
   <xsl:param name="VLine" select="'false'"/>
 
+  <!-- Whether to show non-canonical "headings" or not -->
+  <xsl:param name="Headings" select="'true'"/>
+
   <!-- Whether to show notes or not -->
   <xsl:param name="Notes" select="'true'"/>
 
@@ -126,6 +126,7 @@
   <xsl:template match="/osis">
     <html dir="{$direction}">
       <head>
+        <base href="{$baseURL}"/>
         <xsl:if test="$css != ''">
           <link rel="stylesheet" type="text/css" href="{$css}" title="styling" />
         </xsl:if>
@@ -284,7 +285,10 @@
     <xsl:for-each select=".//*[@subType = 'x-preverse' or @subtype = 'x-preverse']">
       <xsl:choose>
         <xsl:when test="local-name() = 'title'">
-          <h3><xsl:apply-templates /></h3>
+          <!-- Always show canonical titles or if headings is turned on -->
+          <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+            <h3><xsl:apply-templates /></h3>
+          </xsl:if>
         </xsl:when>
         <xsl:otherwise>
           <xsl:apply-templates />
@@ -690,7 +694,6 @@
   </xsl:template>
   
   <!--=======================================================================-->
-  <!-- FIXME: Should we both expand and output?? -->
   <xsl:template match="abbr">
     <abbr class="abbr">
       <xsl:if test="@expansion">
@@ -741,11 +744,17 @@
 
   <!--=======================================================================-->
   <xsl:template match="title">
-    <h2><xsl:apply-templates/></h2>
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <h2><xsl:apply-templates/></h2>
+    </xsl:if>
   </xsl:template>
 
   <xsl:template match="title" mode="jesus">
-    <h2><xsl:apply-templates/></h2>
+    <!-- Always show canonical titles or if headings is turned on -->
+    <xsl:if test="@canonical = 'true' or $Headings = 'true'">
+      <h2><xsl:apply-templates/></h2>
+    </xsl:if>
   </xsl:template>
 
   <!--=======================================================================-->
@@ -819,7 +828,7 @@
   
   <xsl:template match="figure">
     <div class="figure">
-      <img src="{concat($baseURL, @src)}"/>  <!-- FIXME: Not necessarily an image... -->
+      <img src="{concat($baseURL, @src)}"/>   <!-- FIXME: Not necessarily an image... -->
       <xsl:apply-templates/>
     </div>
   </xsl:template>




More information about the jsword-svn mailing list