[jsword-svn] common/java/swing/org/crosswire/common/swing 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
In directory www.crosswire.org:/tmp/cvs-serv23270/java/swing/org/crosswire/common/swing

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

Index: BeanPanel.java
===================================================================
RCS file: /cvs/jsword/common/java/swing/org/crosswire/common/swing/BeanPanel.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** BeanPanel.java	27 Jul 2005 23:26:43 -0000	1.8
--- BeanPanel.java	21 Aug 2005 20:37:49 -0000	1.9
***************
*** 49,52 ****
--- 49,53 ----
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
+  * @author DM Smith [dmsmith555 at yahoo dot com]
   */
  public class BeanPanel extends JPanel
***************
*** 194,198 ****
              {
                  String data = text.getText();
!                 writer.invoke(bean, new Object[] { data });
              }
              catch (Exception ex)
--- 195,219 ----
              {
                  String data = text.getText();
!                 Class argType = writer.getParameterTypes()[0];
!                 if (argType == Integer.class)
!                 {
!                     Integer i = null;
!                     if (data != null && data.length() > 0)
!                     {
!                         try
!                         {
!                             i = new Integer(data);
!                         }
!                         catch (NumberFormatException e)
!                         {
!                             i = null;
!                         }
!                     }
!                     writer.invoke(bean, new Object[] { i });
!                 }
!                 else
!                 {
!                     writer.invoke(bean, new Object[] { data });
!                 }
              }
              catch (Exception ex)

Index: LookAndFeelUtil.java
===================================================================
RCS file: /cvs/jsword/common/java/swing/org/crosswire/common/swing/LookAndFeelUtil.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** LookAndFeelUtil.java	27 Jul 2005 23:26:43 -0000	1.13
--- LookAndFeelUtil.java	21 Aug 2005 20:37:49 -0000	1.14
***************
*** 28,31 ****
--- 28,35 ----
  import javax.swing.plaf.metal.MetalLookAndFeel;
  
+ import org.crosswire.common.swing.plaf.MetalLFCustoms;
+ import org.crosswire.common.swing.plaf.OtherLFCustoms;
+ import org.crosswire.common.swing.plaf.WindowsLFCustoms;
+ 
  /**
   * LookAndFeelUtil declares the Choices and actions
***************
*** 38,41 ****
--- 42,46 ----
   * @author Mark Goodwin [mark at thorubio dot org]
   * @author DM Smith [dmsmith555 at yahoo dot com]
+  * @author Willie Thean [williethean at yahoo dot com]
   */
  public final class LookAndFeelUtil
***************
*** 108,115 ****
          try
          {
              // NOTE(DM): test with the gtk laf before allowing it.
!             if (systemLAF.indexOf("gtk") == -1) //$NON-NLS-1$
              {
                  UIManager.setLookAndFeel(systemLAF);
                  defaultLAF = Class.forName(systemLAF);
              }
--- 113,128 ----
          try
          {
+             // GTKLookAndFeel and MotiflLookAndFeel doesn't look good currently.
+             // Only WindowsLookAndFeel and MetalLookAndFeel looks fine.
+             // Not sure how AquaLookAndFeel looks, so allow it for now.
              // NOTE(DM): test with the gtk laf before allowing it.
!             if (systemLAF.indexOf("WindowsLookAndFeel") != -1 ||  //$NON-NLS-1$
!                 systemLAF.indexOf("AquaLookAndfeel") != -1) //$NON-NLS-1$
              {
                  UIManager.setLookAndFeel(systemLAF);
+                 // MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+                 // UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); //$NON-NLS-1$
+                 // UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
+                 // UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
                  defaultLAF = Class.forName(systemLAF);
              }
***************
*** 131,134 ****
--- 144,166 ----
              assert false;
          }
+ 
+         customizeBDLookandFeel();
+     }
+     
+     private static void customizeBDLookandFeel() 
+     {
+         String currentLF = UIManager.getLookAndFeel().getClass().getName();
+ 
+         if (currentLF.indexOf("MetalLookAndFeel") != -1) //$NON-NLS-1$
+         {
+             new MetalLFCustoms().initUIDefaults();
+         }
+         else if (currentLF.indexOf("WindowsLookAndFeel") != -1) //$NON-NLS-1$
+         {
+             new WindowsLFCustoms().initUIDefaults();
+         }
+         else {
+             new OtherLFCustoms().initUIDefaults();
+         }
      }
  }



More information about the jsword-svn mailing list