[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] Patch: Icons for JTree
From: |
David Gilbert |
Subject: |
Re: [cp-patches] Patch: Icons for JTree |
Date: |
Tue, 12 Jul 2005 22:36:27 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.2 (X11/20050426) |
Lillian Angel wrote:
>2005-07-12 Lillian Angel <address@hidden>
> * javax/swing/plaf/basic/BasicLookAndFeel.java:
> Took out icon defaults.
> * javax/swing/plaf/basic/BasicTreeUI.java
> (installUI): set root to visible
> (getCellBounds): took out addition to width since there may not
> be an icon.
> * javax/swing/plaf/metal/MetalLookAndFeel.java:
> Added in icon defaults
> * lib/Makefile.am:
> Fixed so icons are installed for the JTree
>
>For icons to install properly: make sure you rebuild, reconfigure and
>delete the lib/resources file
>
>
>
I've attached a patch that you can use to try the Metal icons, and a
screen shot showing the Demo (Sun JDK on the left, JamVM/Classpath on
the right). Keep up the good work!
Regards,
Dave Gilbert
Index: javax/swing/plaf/metal/MetalLookAndFeel.java
===================================================================
RCS file:
/cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java,v
retrieving revision 1.26
diff -u -r1.26 MetalLookAndFeel.java
--- javax/swing/plaf/metal/MetalLookAndFeel.java 12 Jul 2005 18:58:00
-0000 1.26
+++ javax/swing/plaf/metal/MetalLookAndFeel.java 12 Jul 2005 21:23:53
-0000
@@ -38,14 +38,11 @@
package javax.swing.plaf.metal;
-import java.awt.Color;
import java.awt.Insets;
-import javax.swing.ImageIcon;
import javax.swing.UIDefaults;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.FontUIResource;
-import javax.swing.plaf.IconUIResource;
import javax.swing.plaf.basic.BasicLookAndFeel;
public class MetalLookAndFeel extends BasicLookAndFeel
@@ -421,7 +418,7 @@
* </tr><tr>
* <td>Button.background</td><td>0xcccccc</td>
* </tr><tr>
- * <td>Button.border</td><td>address@hidden MetalBorders.ButtonBorder}</td>
+ * <td>Button.border</td><td>address@hidden
MetalBorders#getButtonBorder()}</td>
* </tr><tr>
* <td>Button.font</td><td>address@hidden #getControlTextFont}</td>
* </tr><tr>
@@ -505,19 +502,18 @@
new ColorUIResource(getPrimaryControlDarkShadow()),
"ScrollBar.thumbHighlight",
new ColorUIResource(getPrimaryControl()),
+
"SplitPane.darkShadow",
new ColorUIResource(getControlDarkShadow()),
"SplitPane.highlight",
new ColorUIResource(getControlHighlight()),
- "Tree.openIcon",
- new IconUIResource(new ImageIcon(getClass().getResource(
- "/gnu/javax/swing/plaf/gtk/icons/TreeOpen.png"))),
- "Tree.leafIcon",
- new IconUIResource(new ImageIcon(getClass().getResource(
- "/gnu/javax/swing/plaf/gtk/icons/TreeLeaf.png"))),
- "Tree.closedIcon",
- new IconUIResource(new ImageIcon(getClass().getResource(
- "/gnu/javax/swing/plaf/gtk/icons/TreeClosed.png"))),
+
+ "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(),
+ "Tree.closedIcon", MetalIconFactory.getTreeControlIcon(true),
+ "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(),
+ "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true),
+ "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false),
+
"PopupMenu.border", new MetalBorders.PopupMenuBorder()
};
defaults.putDefaults(myDefaults);