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

jswordcvs at crosswire.org jswordcvs at crosswire.org
Tue Apr 5 21:07:43 MST 2005


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

Modified Files:
	ViewSourcePane.java DesktopActions.java Desktop.properties 
	Desktop.java XSLTProperty.java 
Log Message:
Added morphology (like strongs)
Added first pass for history.

Index: Desktop.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/Desktop.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** Desktop.java	3 Apr 2005 04:07:41 -0000	1.39
--- Desktop.java	6 Apr 2005 04:07:41 -0000	1.40
***************
*** 31,34 ****
--- 31,37 ----
  import org.crosswire.bibledesktop.book.BibleViewPane;
  import org.crosswire.bibledesktop.book.DictionaryPane;
+ import org.crosswire.bibledesktop.book.DisplaySelectEvent;
+ import org.crosswire.bibledesktop.book.DisplaySelectListener;
+ import org.crosswire.bibledesktop.book.DisplaySelectPane;
  import org.crosswire.bibledesktop.display.BookDataDisplay;
  import org.crosswire.bibledesktop.display.URLEvent;
***************
*** 37,40 ****
--- 40,44 ----
  import org.crosswire.common.config.ChoiceFactory;
  import org.crosswire.common.config.Config;
+ import org.crosswire.common.history.History;
  import org.crosswire.common.progress.Job;
  import org.crosswire.common.progress.JobManager;
***************
*** 101,105 ****
   * @version $Id$
   */
! public class Desktop extends JFrame implements URLEventListener, ViewEventListener, ViewGenerator
  {
      /**
--- 105,109 ----
   * @version $Id$
   */
! public class Desktop extends JFrame implements URLEventListener, ViewEventListener, DisplaySelectListener, ViewGenerator
  {
      /**
***************
*** 245,248 ****
--- 249,253 ----
          views = new ViewManager(this);
          views.addViewEventListener(this);
+         history = new History();
      }
  
***************
*** 291,299 ****
          menuEdit.setToolTipText(null);
  
          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);
--- 296,305 ----
          menuEdit.setToolTipText(null);
  
+         JMenu menuGo = new JMenu(actions.getAction(DesktopActions.GO));
+         menuGo.add(actions.getAction(DesktopActions.BACK)).addMouseListener(barStatus);
+         menuGo.add(actions.getAction(DesktopActions.FORWARD)).addMouseListener(barStatus);
+         
          JMenu menuView = new JMenu(actions.getAction(DesktopActions.VIEW));
!         JCheckBoxMenuItem toggle = new JCheckBoxMenuItem(actions.getAction(XSLTProperty.START_VERSE_ON_NEWLINE.getName()));
          toggle.setSelected(XSLTProperty.START_VERSE_ON_NEWLINE.getDefault());
          menuView.add(toggle).addMouseListener(barStatus);
***************
*** 310,313 ****
--- 316,325 ----
          toggle.setSelected(XSLTProperty.XREF.getDefault());
          menuView.add(toggle).addMouseListener(barStatus);
+         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.MORPH.getName()));
+         toggle.setSelected(XSLTProperty.MORPH.getDefault());
+         menuView.add(toggle).addMouseListener(barStatus);
          menuView.addSeparator();
          menuView.add(views.getTdiView()).addMouseListener(barStatus);
***************
*** 364,367 ****
--- 376,382 ----
          //pnlTbar.add(actions.getAction(DesktopActions.PASTE)).addMouseListener(barStatus);
          pnlTbar.addSeparator();
+         pnlTbar.add(actions.getAction(DesktopActions.BACK)).addMouseListener(barStatus);
+         pnlTbar.add(actions.getAction(DesktopActions.FORWARD)).addMouseListener(barStatus);
+         pnlTbar.addSeparator();
          //pnlTbar.add(actions.getAction("Generate")).addMouseListener(barStatus);
          //pnlTbar.add(actions.getAction("Diff")).addMouseListener(barStatus);
***************
*** 424,427 ****
--- 439,444 ----
          display.addURLEventListener(this);
          display.addURLEventListener(barStatus);
+         DisplaySelectPane dsp = view.getSelectPane();
+         dsp.addCommandListener(this);
          return view;
      }
***************
*** 436,439 ****
--- 453,488 ----
          display.removeURLEventListener(this);
          display.removeURLEventListener(barStatus);
+         DisplaySelectPane dsp = view.getSelectPane();
+         dsp.removeCommandListener(this);
+     }
+ 
+     /* (non-Javadoc)
+      * @see org.crosswire.bibledesktop.book.DisplaySelectListener#bookChosen(org.crosswire.bibledesktop.book.DisplaySelectEvent)
+      */
+     public void bookChosen(DisplaySelectEvent ev)
+     {
+         // Do nothing        
+     }
+ 
+     /* (non-Javadoc)
+      * @see org.crosswire.bibledesktop.book.DisplaySelectListener#passageSelected(org.crosswire.bibledesktop.book.DisplaySelectEvent)
+      */
+     public void passageSelected(DisplaySelectEvent ev)
+     {
+         Key key = ev.getKey();
+         if (key != null && ! key.isEmpty())
+         {
+             // add the string because keys are heavyweights
+             history.add(key.getName());
+         }
+     }
+ 
+     public void selectHistory(int i)
+     {
+         Object obj = history.go(i);
+         if (obj != null)
+         {
+             activateURL(new URLEvent(this, Desktop.BIBLE_PROTOCOL, (String) obj));
+         }
      }
  
***************
*** 806,809 ****
--- 855,859 ----
      private DictionaryPane reference;
      private JSplitPane sptBooks;
+     private History history;
  
      /**

Index: XSLTProperty.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/XSLTProperty.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** XSLTProperty.java	6 Mar 2005 20:21:36 -0000	1.2
--- XSLTProperty.java	6 Apr 2005 04:07:41 -0000	1.3
***************
*** 37,40 ****
--- 37,45 ----
  
      /**
+      * Determines whether Word Morphology (e.g. Robinson) should show
+      */
+     public static final XSLTProperty MORPH = new XSLTProperty("Morph", false); //$NON-NLS-1$
+ 
+     /**
       * Determines whether verses should start on a new line.
       */
***************
*** 172,175 ****
--- 177,181 ----
      {
          STRONGS_NUMBERS,
+         MORPH,
          START_VERSE_ON_NEWLINE,
          VERSE_NUMBERS,

Index: Desktop.properties
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/Desktop.properties,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Desktop.properties	6 Mar 2005 04:55:44 -0000	1.7
--- Desktop.properties	6 Apr 2005 04:07:41 -0000	1.8
***************
*** 38,41 ****
--- 38,51 ----
  Edit.AcceleratorKey.Modifiers=
  
+ Go.Enabled=true
+ Go.Name=Go
+ Go.ShortDescription=Go
+ Go.LongDescription=Go
+ Go.SmallIcon=
+ Go.LargeIcon=
+ Go.MnemonicKey=G
+ Go.AcceleratorKey=
+ Go.AcceleratorKey.Modifiers=
+ 
  View.Enabled=true
  View.Name=View
***************
*** 213,216 ****
--- 223,246 ----
  Paste.AcceleratorKey.Modifiers=alt
  
+ Back.Name=Back
+ Back.ShortDescription=Go Back
+ Back.LongDescription=Go back to previous passage.
+ Back.SmallIcon=toolbarButtonGraphics/navigation/Back16.gif
+ Back.LargeIcon=toolbarButtonGraphics/navigation/Back24.gif
+ Back.MnemonicKey=B
+ # KeyEvent.VK_LEFT
+ Back.AcceleratorKey=0x25
+ Back.AcceleratorKey.Modifiers=alt
+ 
+ Forward.Name=Forward
+ Forward.ShortDescription=Go Forward
+ Forward.LongDescription=Go forward to next passage.
+ Forward.SmallIcon=toolbarButtonGraphics/navigation/Forward16.gif
+ Forward.LargeIcon=toolbarButtonGraphics/navigation/Forward24.gif
+ Forward.MnemonicKey=F
+ # KeyEvent.VK_RIGHT
+ Forward.AcceleratorKey=0x27
+ Forward.AcceleratorKey.Modifiers=alt
+ 
  Strongs.Name=Show Strongs Links
  Strongs.ShortDescription=Show Strong''s links
***************
*** 222,225 ****
--- 252,264 ----
  Strongs.AcceleratorKey.Modifiers=
  
+ Morph.Name=Show Word Morphology
+ Morph.ShortDescription=Show Word Morphology
+ Morph.LongDescription=Show Word Morphology as Links
+ Morph.SmallIcon=
+ Morph.LargeIcon=
+ Morph.MnemonicKey=
+ Morph.AcceleratorKey=
+ Morph.AcceleratorKey.Modifiers=
+ 
  VLine.Name=Start Verses on Separate Lines
  VLine.ShortDescription=Start Verses on Separate Lines
***************
*** 406,410 ****
  Contents.LargeIcon=toolbarButtonGraphics/general/Help24.gif
  Contents.MnemonicKey=C
! # VK_F1
  Contents.AcceleratorKey=0x70
  Contents.AcceleratorKey.Modifiers=
--- 445,449 ----
  Contents.LargeIcon=toolbarButtonGraphics/general/Help24.gif
  Contents.MnemonicKey=C
! # KeyEvent.VK_F1
  Contents.AcceleratorKey=0x70
  Contents.AcceleratorKey.Modifiers=

Index: DesktopActions.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/DesktopActions.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** DesktopActions.java	20 Mar 2005 02:34:57 -0000	1.22
--- DesktopActions.java	6 Apr 2005 04:07:41 -0000	1.23
***************
*** 211,214 ****
--- 211,230 ----
      }
  
+     /**
+      * Go to previous passage.
+      */
+     public void doBack()
+     {
+         getDesktop().selectHistory(-1);
+     }
+ 
+     /**
+      * Go to next passage.
+      */
+     public void doForward()
+     {
+         getDesktop().selectHistory(1);
+     }
+ 
      public void doStrongs(ActionEvent ev)
      {
***************
*** 220,223 ****
--- 236,248 ----
      }
  
+     public void doMorph(ActionEvent ev)
+     {
+         JCheckBoxMenuItem toggle = (JCheckBoxMenuItem) ev.getSource();
+         XSLTProperty.MORPH.setState(toggle.isSelected());
+         BibleViewPane view = (BibleViewPane) getDesktop().getViews().getSelected();
+         SplitBookDataDisplay da = view.getPassagePane();
+         da.getBookDataDisplay().refresh();
+     }
+ 
      public void doVLine(ActionEvent ev)
      {
***************
*** 381,384 ****
--- 406,410 ----
      static final String FILE = "File"; //$NON-NLS-1$
      static final String EDIT = "Edit"; //$NON-NLS-1$
+     static final String GO = "Go"; //$NON-NLS-1$
      static final String VIEW = "View"; //$NON-NLS-1$
      static final String TOOLS = "Tools"; //$NON-NLS-1$
***************
*** 390,393 ****
--- 416,421 ----
      static final String EXIT = "Exit"; //$NON-NLS-1$
      static final String COPY = "Copy"; //$NON-NLS-1$
+     static final String BACK = "Back"; //$NON-NLS-1$
+     static final String FORWARD = "Forward"; //$NON-NLS-1$
      static final String TOOLTIP_TOGGLE = "ToolTipToggle"; //$NON-NLS-1$
      static final String STATUS_TOGGLE = "StatusToggle"; //$NON-NLS-1$

Index: ViewSourcePane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/desktop/ViewSourcePane.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** ViewSourcePane.java	3 Apr 2005 04:07:41 -0000	1.11
--- ViewSourcePane.java	6 Apr 2005 04:07:41 -0000	1.12
***************
*** 84,87 ****
--- 84,88 ----
              TransformingSAXEventProvider htmlsep = (TransformingSAXEventProvider) converter.convert(osissep);
              htmlsep.setParameter(XSLTProperty.STRONGS_NUMBERS.getName(), Boolean.toString(XSLTProperty.STRONGS_NUMBERS.getState()));
+             htmlsep.setParameter(XSLTProperty.MORPH.getName(), Boolean.toString(XSLTProperty.MORPH.getState()));
              htmlsep.setParameter(XSLTProperty.START_VERSE_ON_NEWLINE.getName(), Boolean.toString(XSLTProperty.START_VERSE_ON_NEWLINE.getState()));
              htmlsep.setParameter(XSLTProperty.VERSE_NUMBERS.getName(), Boolean.toString(XSLTProperty.VERSE_NUMBERS.getState()));



More information about the jsword-svn mailing list