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

jswordcvs at crosswire.org jswordcvs at crosswire.org
Tue May 3 17:26:45 MST 2005


Update of /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/display/tab
In directory www.crosswire.org:/tmp/cvs-serv12607/java/main/org/crosswire/bibledesktop/display/tab

Modified Files:
	TabbedBookDataDisplay.java 
Log Message:
Fixed a bug in TabbedBookDisplay.getInnerDisplayPane, which manifested itself in Edit->copy when there were tabs.
Also, fixed the performance problem with ViewSourcePane, by not stylizing the text in an HTMLEditorKit and by limiting the text to the selected tab's tab.

Index: TabbedBookDataDisplay.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/display/tab/TabbedBookDataDisplay.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** TabbedBookDataDisplay.java	5 Apr 2005 00:33:30 -0000	1.19
--- TabbedBookDataDisplay.java	4 May 2005 00:26:43 -0000	1.20
***************
*** 4,11 ****
--- 4,14 ----
  import java.awt.Component;
  import java.util.ArrayList;
+ import java.util.HashMap;
  import java.util.Iterator;
  import java.util.List;
+ import java.util.Map;
  
  import javax.swing.JPanel;
+ import javax.swing.JScrollPane;
  import javax.swing.JTabbedPane;
  import javax.swing.SwingConstants;
***************
*** 109,112 ****
--- 112,116 ----
          // Tabbed view or not we should clear out the old tabs
          tabMain.removeAll();
+         views.clear();
          displays.clear();
          displays.add(pnlView);
***************
*** 143,146 ****
--- 147,151 ----
  
              Component display = pnlNew.getComponent();
+             views.put(display, pnlNew);
  
              tabMain.add(getTabName(first), display);
***************
*** 292,295 ****
--- 297,302 ----
  
              Component display = pnlNew.getComponent();
+             views.put(display, pnlNew);
+ 
              tabMain.add(getTabName(next), display);
  
***************
*** 312,320 ****
       * Accessor for the current TextComponent
       */
!     private BookDataDisplay getInnerDisplayPane()
      {
          if (tabs)
          {
!             return (BookDataDisplay) tabMain.getSelectedComponent();
          }
          return pnlView;
--- 319,329 ----
       * Accessor for the current TextComponent
       */
!     public BookDataDisplay getInnerDisplayPane()
      {
          if (tabs)
          {
!             Object o = tabMain.getSelectedComponent();
!             JScrollPane sp = (JScrollPane) o;
!             return (BookDataDisplay) views.get(sp);
          }
          return pnlView;
***************
*** 421,428 ****
  
      /**
       * A list of all the InnerDisplayPanes so we can control listeners
       */
      private List displays = new ArrayList();
! 
      /**
       * Pointer to whichever of the above is currently in use
--- 430,442 ----
  
      /**
+      * An map of compnents to their views
+      */
+     private Map views = new HashMap();
+ 
+     /**
       * A list of all the InnerDisplayPanes so we can control listeners
       */
      private List displays = new ArrayList();
!     
      /**
       * Pointer to whichever of the above is currently in use



More information about the jsword-svn mailing list