classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] FYI: Add icon for InternalFrame


From: Roman Kennke
Subject: [cp-patches] FYI: Add icon for InternalFrame
Date: Wed, 20 Jul 2005 17:28:04 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

I added an entry in BasicLookAndFeel for InternalFrame.icon. An empty icon is set ATM, but that is still better than a null icon for apps that depend on an icon beeing present (like mine here).

We could need a nice replacement for the JavaCup icon btw. If someone has some design skills or a girlfriend with designskills (I promise to ask mine :-) ) please consider making one.


2005-07-20  Roman Kennke  <address@hidden>

       * javax/swing/plaf/basic/BasicLookAndFeel.java
       (initComponentDefaults): Added value for InternalFrame.icon.
       * javax/swing/plaf/basic/BasicInternalFrameUI.java
       (installDefaults): Install icon from UIDefaults.

/Roman

Index: javax/swing/plaf/basic/BasicInternalFrameUI.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java,v
retrieving revision 1.14
diff -u -r1.14 BasicInternalFrameUI.java
--- javax/swing/plaf/basic/BasicInternalFrameUI.java    20 Jul 2005 13:10:26 
-0000      1.14
+++ javax/swing/plaf/basic/BasicInternalFrameUI.java    20 Jul 2005 15:16:19 
-0000
@@ -1199,7 +1199,7 @@
       Border border = new BorderUIResource.CompoundBorderUIResource(outer,
                                                                    inner);
       frame.setBorder(border);
-
+      frame.setFrameIcon(defaults.getIcon("InternalFrame.icon"));
       // InternalFrames are invisible by default.
       frame.setVisible(false);
   }
Index: javax/swing/plaf/basic/BasicLookAndFeel.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicLookAndFeel.java,v
retrieving revision 1.37
diff -u -r1.37 BasicLookAndFeel.java
--- javax/swing/plaf/basic/BasicLookAndFeel.java        18 Jul 2005 15:00:00 
-0000      1.37
+++ javax/swing/plaf/basic/BasicLookAndFeel.java        20 Jul 2005 15:16:19 
-0000
@@ -57,6 +57,7 @@
 import javax.swing.plaf.ColorUIResource;
 import javax.swing.plaf.DimensionUIResource;
 import javax.swing.plaf.FontUIResource;
+import javax.swing.plaf.IconUIResource;
 import javax.swing.plaf.InsetsUIResource;
 import javax.swing.text.JTextComponent;
 
@@ -480,8 +481,15 @@
       "InternalFrame.borderLight", new ColorUIResource(Color.LIGHT_GRAY),
       "InternalFrame.borderShadow", new ColorUIResource(Color.GRAY),
       "InternalFrame.closeIcon", BasicIconFactory.createEmptyFrameIcon(),
-      // XXX Don't use gif
-//      "InternalFrame.icon", new IconUIResource(new 
ImageIcon("icons/JavaCup.gif")),
+      // FIXME: Set a nice icon for InternalFrames here.
+      "InternalFrame.icon",
+      new UIDefaults.LazyValue()
+      {
+        public Object createValue(UIDefaults def)
+        {
+          return new IconUIResource(BasicIconFactory.createEmptyFrameIcon());
+        }
+      },
       "InternalFrame.iconifyIcon", BasicIconFactory.createEmptyFrameIcon(),
       "InternalFrame.inactiveTitleBackground", new ColorUIResource(Color.gray),
       "InternalFrame.inactiveTitleForeground",

reply via email to

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