classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Patch: JTree defaults


From: David Gilbert
Subject: Re: [cp-patches] Patch: JTree defaults
Date: Wed, 13 Jul 2005 22:46:17 +0000
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050426)

Lillian Angel wrote:

>2005-07-13 Lillian Angel <address@hidden>i
>
>        * javax/swing/plaf/basic/BasicLookAndFeel.java: Changed font to
>        match jdk.
>        * javax/swing/plaf/basic/BasicTreeUI.java: took out unneeded
>        import statement
>        * javax/swing/plaf/metal/MetalLookAndFeel.java: Changed
>        defaults to match jdk.
>
>  
>
>------------------------------------------------------------------------
>
>Index: javax/swing/plaf/basic/BasicLookAndFeel.java
>===================================================================
>RCS file: 
>/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java,v
>retrieving revision 1.34
>diff -u -r1.34 BasicLookAndFeel.java
>--- javax/swing/plaf/basic/BasicLookAndFeel.java       13 Jul 2005 19:00:45 
>-0000      1.34
>+++ javax/swing/plaf/basic/BasicLookAndFeel.java       13 Jul 2005 21:07:35 
>-0000
>@@ -1036,7 +1036,7 @@
>         "PAGE_UP",  "scrollUpChangeSelection",
>         "ctrl PAGE_DOWN", "scrollDownChangeLead"
>       }),
>-      "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12),
>+      "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)),
>       "Tree.foreground", new ColorUIResource(Color.black),
>       "Tree.hash", new ColorUIResource(Color.gray),
>       "Tree.leftChildIndent", new Integer(7),
>Index: javax/swing/plaf/basic/BasicTreeUI.java
>===================================================================
>RCS file: 
>/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTreeUI.java,v
>retrieving revision 1.31
>diff -u -r1.31 BasicTreeUI.java
>--- javax/swing/plaf/basic/BasicTreeUI.java    13 Jul 2005 19:00:45 -0000      
>1.31
>+++ javax/swing/plaf/basic/BasicTreeUI.java    13 Jul 2005 21:07:35 -0000
>@@ -87,7 +87,6 @@
> import javax.swing.event.TreeSelectionListener;
> import javax.swing.plaf.ComponentUI;
> import javax.swing.plaf.TreeUI;
>-import javax.swing.plaf.metal.MetalIconFactory;
> import javax.swing.tree.AbstractLayoutCache;
> import javax.swing.tree.FixedHeightLayoutCache;
> import javax.swing.tree.DefaultMutableTreeNode;
>
>Index: javax/swing/plaf/metal/MetalLookAndFeel.java
>===================================================================
>RCS file: 
>/cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java,v
>retrieving revision 1.28
>diff -u -r1.28 MetalLookAndFeel.java
>--- javax/swing/plaf/metal/MetalLookAndFeel.java       13 Jul 2005 19:00:45 
>-0000      1.28
>+++ javax/swing/plaf/metal/MetalLookAndFeel.java       13 Jul 2005 21:07:35 
>-0000
>@@ -38,6 +38,8 @@
> 
> package javax.swing.plaf.metal;
> 
>+import java.awt.Color;
>+import java.awt.Font;
> import java.awt.Insets;
> 
> import javax.swing.ImageIcon;
>@@ -805,7 +807,21 @@
>       "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(),
>       "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true),
>       "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false),
>-
>+      "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)),
>+      "Tree.background", new ColorUIResource(Color.white),
>+      "Tree.foreground", new ColorUIResource(new Color(204, 204, 255)),
>+      "Tree.hash", new ColorUIResource(new Color(204, 204, 255)),
>+      "Tree.leftChildIndent", new Integer(7),
>+      "Tree.rightChildIndent", new Integer(13),
>+      "Tree.rowHeight", new Integer(20),
>+      "Tree.scrollsOnExpand", Boolean.TRUE,
>+      "Tree.selectionBackground", new ColorUIResource(new Color(204, 204, 
>255)),
>+      "Tree.nonSelectionBackground", new ColorUIResource(Color.white),
>+      "Tree.selectionBorderColor", new ColorUIResource(new Color(102, 102, 
>153)),
>+      "Tree.selectionForeground", new ColorUIResource(Color.black),
>+      "Tree.textBackground", new ColorUIResource(new Color(204, 204, 255)),
>+      "Tree.textForeground", new ColorUIResource(Color.black),
>+      "Tree.selectionForeground", new ColorUIResource(new Color(0, 0, 0)),
>       "PopupMenu.border", new MetalBorders.PopupMenuBorder()
>     };
>     defaults.putDefaults(myDefaults);
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Classpath-patches mailing list
>address@hidden
>http://lists.gnu.org/mailman/listinfo/classpath-patches
>  
>
I'm pretty sure you shouldn't use "Helvetica" for the font, since it
isn't guaranteed to be present on all platforms.  Whereas "Dialog" is a
logical font name recognised by Java and mapped to a platform specific
equivalent ("Helvetica" on some platforms, "Arial" on others, etc.).

Here is a link with more info:

http://java.sun.com/j2se/1.4.2/docs/guide/intl/fontprop.html

Regards,

Dave Gilbert




reply via email to

[Prev in Thread] Current Thread [Next in Thread]