[jsword-svn] bibledesktop/java/main/org/crosswire/bibledesktop/desktop s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sat Mar 5 21:55:46 MST 2005


Update of /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop
In directory www.crosswire.org:/tmp/cvs-serv397/java/main/org/crosswire/bibledesktop/desktop

Modified Files:
	DesktopActions.java Desktop.properties Desktop.java 
Added Files:
	XSLTProperty.java 
Log Message:
Added toggles to view menu for bible features.
Unified the three osis->html xslt

Index: Desktop.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/Desktop.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** Desktop.java	17 Feb 2005 03:40:19 -0000	1.34
--- Desktop.java	6 Mar 2005 04:55:44 -0000	1.35
***************
*** 296,299 ****
--- 296,318 ----
  
          JMenu menuView = new JMenu(actions.getAction(DesktopActions.VIEW));
+         JCheckBoxMenuItem toggle = new JCheckBoxMenuItem(actions.getAction(XSLTProperty.STRONGS_NUMBERS.getName()));
+         toggle.setSelected(XSLTProperty.STRONGS_NUMBERS.getDefault());
+         menuView.add(toggle).addMouseListener(barStatus);
+         toggle = new JCheckBoxMenuItem(actions.getAction(XSLTProperty.START_VERSE_ON_NEWLINE.getName()));
+         toggle.setSelected(XSLTProperty.START_VERSE_ON_NEWLINE.getDefault());
+         menuView.add(toggle).addMouseListener(barStatus);
+         toggle = new JCheckBoxMenuItem(actions.getAction(XSLTProperty.VERSE_NUMBERS.getName()));
+         toggle.setSelected(XSLTProperty.VERSE_NUMBERS.getDefault());
+         menuView.add(toggle).addMouseListener(barStatus);
+         toggle = new JCheckBoxMenuItem(actions.getAction(XSLTProperty.TINY_VERSE_NUMBERS.getName()));
+         toggle.setSelected(XSLTProperty.TINY_VERSE_NUMBERS.getDefault());
+         menuView.add(toggle).addMouseListener(barStatus);
+         toggle = new JCheckBoxMenuItem(actions.getAction(XSLTProperty.NOTES.getName()));
+         toggle.setSelected(XSLTProperty.NOTES.getDefault());
+         menuView.add(toggle).addMouseListener(barStatus);
+         toggle = new JCheckBoxMenuItem(actions.getAction(XSLTProperty.XREF.getName()));
+         toggle.setSelected(XSLTProperty.XREF.getDefault());
+         menuView.add(toggle).addMouseListener(barStatus);
+         menuView.addSeparator();
          menuView.add(views.getTdiView()).addMouseListener(barStatus);
          menuView.add(views.getMdiView()).addMouseListener(barStatus);
***************
*** 303,307 ****
          menuView.add(pnlTbar.getTextToggle()).addMouseListener(barStatus);
          menuView.add(pnlTbar.getIconSizeToggle()).addMouseListener(barStatus);
!         JCheckBoxMenuItem toggle = new JCheckBoxMenuItem(actions.getAction(DesktopActions.TOOLTIP_TOGGLE));
          toggle.setSelected(true);
          menuView.add(toggle).addMouseListener(barStatus);
--- 322,326 ----
          menuView.add(pnlTbar.getTextToggle()).addMouseListener(barStatus);
          menuView.add(pnlTbar.getIconSizeToggle()).addMouseListener(barStatus);
!         toggle = new JCheckBoxMenuItem(actions.getAction(DesktopActions.TOOLTIP_TOGGLE));
          toggle.setSelected(true);
          menuView.add(toggle).addMouseListener(barStatus);
***************
*** 490,493 ****
--- 509,532 ----
                  reference.setKey(key);
              }
+             else if (protocol.equals(GREEK_DEF_PROTOCOL))
+             {
+                 // TODO(DM): determine the right Strong's dictionary and switch to it.
+                 reference.setWord(data);
+             }
+             else if (protocol.equals(HEBREW_DEF_PROTOCOL))
+             {
+                 // TODO(DM): determine the right Strong's dictionary and switch to it.
+                 reference.setWord(data);
+             }
+             else if (protocol.equals(GREEK_MORPH_PROTOCOL))
+             {
+                 // TODO(DM): determine the right Strong's dictionary and switch to it.
+                 reference.setWord(data);
+             }
+             else if (protocol.equals(HEBREW_MORPH_PROTOCOL))
+             {
+                 // TODO(DM): determine the right Strong's dictionary and switch to it.
+                 reference.setWord(data);
+             }
              else if (protocol.equals(DICTIONARY_PROTOCOL))
              {
***************
*** 741,744 ****
--- 780,787 ----
      private static final String BIBLE_PROTOCOL = "bible"; //$NON-NLS-1$
      private static final String DICTIONARY_PROTOCOL = "dict"; //$NON-NLS-1$
+     private static final String GREEK_DEF_PROTOCOL = "gdef"; //$NON-NLS-1$
+     private static final String HEBREW_DEF_PROTOCOL = "hdef"; //$NON-NLS-1$
+     private static final String GREEK_MORPH_PROTOCOL = "gmorph"; //$NON-NLS-1$
+     private static final String HEBREW_MORPH_PROTOCOL = "hmorph"; //$NON-NLS-1$
      private static final String COMMENTARY_PROTOCOL = "comment"; //$NON-NLS-1$
  

--- NEW FILE: XSLTProperty.java ---
package org.crosswire.bibledesktop.desktop;

import java.io.Serializable;


public class XSLTProperty implements Serializable
{

    /**
     * Determines whether Strong's Numbers should show
     */
    public static final XSLTProperty STRONGS_NUMBERS = new XSLTProperty("Strongs", false); //$NON-NLS-1$

    /**
     * Determines whether verses should start on a new line.
     */
    public static final XSLTProperty START_VERSE_ON_NEWLINE = new XSLTProperty("VLine", false); //$NON-NLS-1$

    /**
     * Show verse numbers
     */
    public static final XSLTProperty VERSE_NUMBERS = new XSLTProperty("VNum", true); //$NON-NLS-1$

    /**
     * Show verse numbers as a superscript.
     */
    public static final XSLTProperty TINY_VERSE_NUMBERS = new XSLTProperty("TinyVNum", true); //$NON-NLS-1$

    /**
     * Should notes be shown
     */
    public static final XSLTProperty NOTES = new XSLTProperty("Notes", true); //$NON-NLS-1$

    /**
     * Should cross references be shown
     */
    public static final XSLTProperty XREF = new XSLTProperty("XRef", true); //$NON-NLS-1$

    /**
     * @param name The name of this property
     */
    private XSLTProperty(String name, boolean defaultState)
    {
        this.name = name;
        this.defaultState = defaultState;
        this.state = defaultState;
    }

    /**
     * @return the name of the property
     */
    public String getName()
    {
        return name;
    }

    public boolean getDefault()
    {
        return defaultState; //$NON-NLS-1$
    }
    
    public boolean getState()
    {
        return state;
    }

    public void setState(boolean newState)
    {
        state = newState;
    }
    
    /**
     * Lookup method to convert from a String
     */
    public static XSLTProperty fromString(String name)
    {
        for (int i = 0; i < VALUES.length; i++)
        {
            XSLTProperty o = VALUES[i];
            if (o.name.equalsIgnoreCase(name))
            {
                return o;
            }
        }
        assert false;
        return null;
    }

    /**
     * Lookup method to convert from an integer
     */
    public static XSLTProperty fromInteger(int i)
    {
        return VALUES[i];
    }

    /**
     * Prevent subclasses from overriding canonical identity based Object methods
     * @see java.lang.Object#equals(java.lang.Object)
     */
    public final boolean equals(Object o)
    {
        return super.equals(o);
    }

    /**
     * Prevent subclasses from overriding canonical identity based Object methods
     * @see java.lang.Object#hashCode()
     */
    public final int hashCode()
    {
        return super.hashCode();
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    public String toString()
    {
        return name;
    }

    /**
     * The name of the XSLTProperty
     */
    private String name;

    /**
     * The default state of the XSLTProperty
     */
    private boolean defaultState;

    /**
     * The current state of the XSLTProperty
     */
    private boolean state;

    // Support for serialization
    private static int nextObj;
    private final int obj = nextObj++;

    Object readResolve()
    {
        return VALUES[obj];
    }

    private static final XSLTProperty[] VALUES =
    {
        STRONGS_NUMBERS,
        START_VERSE_ON_NEWLINE,
        VERSE_NUMBERS,
        TINY_VERSE_NUMBERS,
        NOTES,
        XREF,
    };

    /**
     * Serialization ID
     */
    private static final long serialVersionUID = 3257567325749326905L;    
}

Index: DesktopActions.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/DesktopActions.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** DesktopActions.java	17 Feb 2005 03:40:19 -0000	1.18
--- DesktopActions.java	6 Mar 2005 04:55:44 -0000	1.19
***************
*** 220,223 ****
--- 220,277 ----
      }
  
+     public void doStrongs(ActionEvent ev)
+     {
+         JCheckBoxMenuItem toggle = (JCheckBoxMenuItem) ev.getSource();
+         XSLTProperty.STRONGS_NUMBERS.setState(toggle.isSelected());
+         BibleViewPane view = (BibleViewPane) getDesktop().getViews().getSelected();
+         SplitBookDataDisplay da = view.getPassagePane();
+         da.getBookDataDisplay().refresh();
+     }
+     
+     public void doVLine(ActionEvent ev)
+     {
+         JCheckBoxMenuItem toggle = (JCheckBoxMenuItem) ev.getSource();
+         XSLTProperty.START_VERSE_ON_NEWLINE.setState(toggle.isSelected());
+         BibleViewPane view = (BibleViewPane) getDesktop().getViews().getSelected();
+         SplitBookDataDisplay da = view.getPassagePane();
+         da.getBookDataDisplay().refresh();
+     }
+     
+     public void doVNum(ActionEvent ev)
+     {
+         JCheckBoxMenuItem toggle = (JCheckBoxMenuItem) ev.getSource();
+         XSLTProperty.VERSE_NUMBERS.setState(toggle.isSelected());
+         BibleViewPane view = (BibleViewPane) getDesktop().getViews().getSelected();
+         SplitBookDataDisplay da = view.getPassagePane();
+         da.getBookDataDisplay().refresh();
+     }
+     
+     public void doTinyVNum(ActionEvent ev)
+     {
+         JCheckBoxMenuItem toggle = (JCheckBoxMenuItem) ev.getSource();
+         XSLTProperty.TINY_VERSE_NUMBERS.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();
+         XSLTProperty.NOTES.setState(toggle.isSelected());
+         BibleViewPane view = (BibleViewPane) getDesktop().getViews().getSelected();
+         SplitBookDataDisplay da = view.getPassagePane();
+         da.getBookDataDisplay().refresh();
+     }
+     
+     public void doXRef(ActionEvent ev)
+     {
+         JCheckBoxMenuItem toggle = (JCheckBoxMenuItem) ev.getSource();
+         XSLTProperty.XREF.setState(toggle.isSelected());
+         BibleViewPane view = (BibleViewPane) getDesktop().getViews().getSelected();
+         SplitBookDataDisplay da = view.getPassagePane();
+         da.getBookDataDisplay().refresh();
+     }
+ 
      /**
       * View the HTML as interpreted by the current window.

Index: Desktop.properties
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/Desktop.properties,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Desktop.properties	26 Nov 2004 21:37:47 -0000	1.6
--- Desktop.properties	6 Mar 2005 04:55:44 -0000	1.7
***************
*** 213,216 ****
--- 213,270 ----
  Paste.AcceleratorKey.Modifiers=alt
  
+ Strongs.Name=Show Strongs Links
+ Strongs.ShortDescription=Show Strong''s links
+ Strongs.LongDescription=Show Strong''s Numbers as Links
+ Strongs.SmallIcon=
+ Strongs.LargeIcon=
+ Strongs.MnemonicKey=
+ Strongs.AcceleratorKey=
+ Strongs.AcceleratorKey.Modifiers=
+ 
+ VLine.Name=Start Verses on Separate Lines
+ VLine.ShortDescription=Start Verses on Separate Lines
+ VLine.LongDescription=Each verse starts on a new line.
+ VLine.SmallIcon=
+ VLine.LargeIcon=
+ VLine.MnemonicKey=
+ VLine.AcceleratorKey=
+ VLine.AcceleratorKey.Modifiers=
+ 
+ VNum.Name=Show Verse Numbers
+ VNum.ShortDescription=Show Verse numbers
+ VNum.LongDescription=Show verse numbers
+ VNum.SmallIcon=
+ VNum.LargeIcon=
+ VNum.MnemonicKey=
+ VNum.AcceleratorKey=
+ VNum.AcceleratorKey.Modifiers=
+ 
+ TinyVNum.Name=Use Small Verse Numbers
+ TinyVNum.ShortDescription=Use small verse numbers
+ TinyVNum.LongDescription=Use small verse numbers
+ TinyVNum.SmallIcon=
+ TinyVNum.LargeIcon=
+ TinyVNum.MnemonicKey=
+ TinyVNum.AcceleratorKey=
+ TinyVNum.AcceleratorKey.Modifiers=
+ 
+ Notes.Name=Show Study Notes
+ Notes.ShortDescription=Show Study Notes
+ Notes.LongDescription=Show Study Notes
+ Notes.SmallIcon=
+ Notes.LargeIcon=
+ Notes.MnemonicKey=
+ Notes.AcceleratorKey=
+ Notes.AcceleratorKey.Modifiers=
+ 
+ XRef.Name=Use Cross Reference Linkings
+ XRef.ShortDescription=Use cross reference links
+ XRef.LongDescription=Use cross reference links
+ XRef.SmallIcon=
+ XRef.LargeIcon=
+ XRef.MnemonicKey=
+ XRef.AcceleratorKey=
+ XRef.AcceleratorKey.Modifiers=
+ 
  TabMode.Enabled=true
  TabMode.Name=Tabbed Mode



More information about the jsword-svn mailing list