[jsword-svn] common/java/swing/org/crosswire/common/swing/desktop s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sun Aug 21 13:37:51 MST 2005


Update of /cvs/jsword/common/java/swing/org/crosswire/common/swing/desktop
In directory www.crosswire.org:/tmp/cvs-serv23270/java/swing/org/crosswire/common/swing/desktop

Modified Files:
	TDIViewLayout.java AbstractViewLayout.java 
Added Files:
	TabbedPanePanel.java 
Log Message:
Willie Thean's laf changes.
Added ability to specify proxy for http download.
Changed default logging to INFO.

Index: TDIViewLayout.java
===================================================================
RCS file: /cvs/jsword/common/java/swing/org/crosswire/common/swing/desktop/TDIViewLayout.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TDIViewLayout.java	27 Jul 2005 23:26:43 -0000	1.6
--- TDIViewLayout.java	21 Aug 2005 20:37:49 -0000	1.7
***************
*** 23,31 ****
  
  import java.awt.Component;
  import java.awt.event.MouseListener;
- 
- import javax.swing.BorderFactory;
  import javax.swing.JPopupMenu;
  import javax.swing.JTabbedPane;
  
  
--- 23,32 ----
  
  import java.awt.Component;
+ import java.awt.Dimension;
  import java.awt.event.MouseListener;
  import javax.swing.JPopupMenu;
  import javax.swing.JTabbedPane;
+ import javax.swing.UIManager;
+ import javax.swing.plaf.TabbedPaneUI;
  
  
***************
*** 48,52 ****
          super();
          tabs = new JTabbedPane();
!         tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
      }
  
--- 49,57 ----
          super();
          tabs = new JTabbedPane();
!         if (UIManager.getDefaults().containsKey("BibleViewPane.TabbedPaneUI")) //$NON-NLS-1$
!         {
!             tabs.setUI((TabbedPaneUI) UIManager.get("BibleViewPane.TabbedPaneUI")); //$NON-NLS-1$
!         }
!         tabs.setMinimumSize(new Dimension(0, 0));
      }
  
***************
*** 59,63 ****
  
          if (viewCount > 0)
!         {
              if (viewCount == 1)
              {
--- 64,68 ----
  
          if (viewCount > 0)
!         {               
              if (viewCount == 1)
              {
***************
*** 67,70 ****
--- 72,76 ----
                  getPanel().add(tabs, getConstraint());
              }
+ 
              tabs.add(component, getTitle(component));
              tabs.setSelectedComponent(component);

--- NEW FILE: TabbedPanePanel.java ---
/**
 * Distribution License:
 * JSword is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License, version 2.1 as published by
 * the Free Software Foundation. This program is distributed in the hope
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * The License is available on the internet at:
 *       http://www.gnu.org/copyleft/lgpl.html
 * or by writing to:
 *      Free Software Foundation, Inc.
 *      59 Temple Place - Suite 330
 *      Boston, MA 02111-1307, USA
 *
 * Copyright: 2005
 *     The copyright to this program is held by it's authors.
 *
 * ID: $Id: TabbedPanePanel.java,v 1.1 2005/08/21 20:37:49 dmsmith Exp $
 */
package org.crosswire.common.swing.desktop;

import java.awt.Insets;
import java.awt.LayoutManager;

import javax.swing.JPanel;
import javax.swing.UIManager;

/**
 * A JPanel class where it's child components will paint on top of its border.
 *
 * @see gnu.lgpl.License for license details.
 *      The copyright to this program is held by it's authors.
 * @author Willie Thean [williethean at yahoo dot com]
 */
public class TabbedPanePanel extends JPanel 
{   
    public TabbedPanePanel() 
    {
        super();
        init();
    }
    
    public TabbedPanePanel(boolean isDoubleBuffered) 
    {
        super(isDoubleBuffered);
        init();
    }
    
    public TabbedPanePanel(LayoutManager layout) 
    {
        super(layout);
        init();
    }
    
    public TabbedPanePanel(LayoutManager layout, boolean isDoubleBuffered) 
    {
        super(layout, isDoubleBuffered);
        init();
    }
    
    private void init() 
    {
        this.setBorder(UIManager.getBorder("TabbedPanePanel.border")); //$NON-NLS-1$
    }
    
    /**
     * If we setBorder on this JPanel, the border width will be part of the insets. 
     * We return an insets of 0 so the child components will paint on top of the
     * border. 
     */
    public Insets getInsets() 
    {
        return new Insets(0, 0, 0, 0);
    }

    /**
     * Serialization ID
     */
    private static final long serialVersionUID = 5254437923545591019L;
}
Index: AbstractViewLayout.java
===================================================================
RCS file: /cvs/jsword/common/java/swing/org/crosswire/common/swing/desktop/AbstractViewLayout.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AbstractViewLayout.java	27 Jul 2005 23:26:43 -0000	1.4
--- AbstractViewLayout.java	21 Aug 2005 20:37:49 -0000	1.5
***************
*** 22,28 ****
  package org.crosswire.common.swing.desktop;
  
  import java.awt.Component;
  import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
  import java.util.ArrayList;
  import java.util.Collection;
--- 22,28 ----
  package org.crosswire.common.swing.desktop;
  
+ import java.awt.BorderLayout;
  import java.awt.Component;
  import java.awt.GridBagConstraints;
  import java.util.ArrayList;
  import java.util.Collection;
***************
*** 52,64 ****
      protected AbstractViewLayout()
      {
!         panel = new JPanel(new GridBagLayout());
! 
          views = new ArrayList();
          listenerList = new EventListenerList();
- 
-         gbc = new GridBagConstraints();
-         gbc.fill = GridBagConstraints.BOTH;
-         gbc.weightx = 1.0;
-         gbc.weighty = 1.0;
      }
  
--- 52,58 ----
      protected AbstractViewLayout()
      {
!         panel = new JPanel(new BorderLayout());
          views = new ArrayList();
          listenerList = new EventListenerList();
      }
  



More information about the jsword-svn mailing list