[kaffe] CVS kaffe (robilad): resynced with gnu classpath: swing fixes
Kaffe CVS
cvs-commits at kaffe.org
Sun May 15 11:31:21 PDT 2005
PatchSet 6525
Date: 2005/05/15 18:17:09
Author: robilad
Branch: HEAD
Tag: (none)
Log:
resynced with gnu classpath: swing fixes
2005-05-15 Dalibor Topic <robilad at kaffe.org>
Resynced with GNU Classpath.
2005-05-11 Roman Kennke <roman at kennke.org>
* javax/swing/plaf/basic/DefaultMenuLayout.java:
Added this class.
* javax/swing/plaf/basic/BasicPopupMenuUI.java
(installUI): Use the new DefaultMenuLayout instead of GridBagLayout.
Members:
ChangeLog:1.4051->1.4052
libraries/javalib/all.files:1.122->1.123
libraries/javalib/javax/swing/plaf/basic/BasicPopupMenuUI.java:1.6->1.7
libraries/javalib/javax/swing/plaf/basic/DefaultMenuLayout.java:INITIAL->1.1
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4051 kaffe/ChangeLog:1.4052
--- kaffe/ChangeLog:1.4051 Sun May 15 18:11:20 2005
+++ kaffe/ChangeLog Sun May 15 18:17:09 2005
@@ -4,6 +4,17 @@
2005-05-11 Roman Kennke <roman at kennke.org>
+ * javax/swing/plaf/basic/DefaultMenuLayout.java:
+ Added this class.
+ * javax/swing/plaf/basic/BasicPopupMenuUI.java
+ (installUI): Use the new DefaultMenuLayout instead of GridBagLayout.
+
+2005-05-15 Dalibor Topic <robilad at kaffe.org>
+
+ Resynced with GNU Classpath.
+
+ 2005-05-11 Roman Kennke <roman at kennke.org>
+
* javax/swing/AbstractCellEditor.java
(constructor): Implemented.
(isCellEditable): Implemented.
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.122 kaffe/libraries/javalib/all.files:1.123
--- kaffe/libraries/javalib/all.files:1.122 Sun May 15 16:50:05 2005
+++ kaffe/libraries/javalib/all.files Sun May 15 18:17:15 2005
@@ -3356,6 +3356,7 @@
javax/swing/plaf/basic/BasicTreeUI.java
javax/swing/plaf/basic/BasicViewportUI.java
javax/swing/plaf/basic/ComboPopup.java
+javax/swing/plaf/basic/DefaultMenuLayout.java
javax/swing/plaf/BorderUIResource.java
javax/swing/plaf/ButtonUI.java
javax/swing/plaf/ColorChooserUI.java
Index: kaffe/libraries/javalib/javax/swing/plaf/basic/BasicPopupMenuUI.java
diff -u kaffe/libraries/javalib/javax/swing/plaf/basic/BasicPopupMenuUI.java:1.6 kaffe/libraries/javalib/javax/swing/plaf/basic/BasicPopupMenuUI.java:1.7
--- kaffe/libraries/javalib/javax/swing/plaf/basic/BasicPopupMenuUI.java:1.6 Sun May 15 09:46:23 2005
+++ kaffe/libraries/javalib/javax/swing/plaf/basic/BasicPopupMenuUI.java Sun May 15 18:17:16 2005
@@ -40,11 +40,11 @@
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
-import java.awt.GridBagLayout;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.MouseEvent;
+import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import javax.swing.MenuElement;
@@ -111,7 +111,7 @@
{
super.installUI(c);
popupMenu = (JPopupMenu) c;
- popupMenu.setLayout(new GridBagLayout());
+ popupMenu.setLayout(new DefaultMenuLayout(popupMenu, BoxLayout.Y_AXIS));
popupMenu.setBorderPainted(true);
JPopupMenu.setDefaultLightWeightPopupEnabled(true);
===================================================================
Checking out kaffe/libraries/javalib/javax/swing/plaf/basic/DefaultMenuLayout.java
RCS: /home/cvs/kaffe/kaffe/libraries/javalib/javax/swing/plaf/basic/DefaultMenuLayout.java,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/libraries/javalib/javax/swing/plaf/basic/DefaultMenuLayout.java Sun May 15 18:31:21 2005
@@ -0,0 +1,78 @@
+/* DefaultMenuLayout.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath 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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.plaf.basic;
+
+import java.awt.Container;
+import java.awt.Dimension;
+
+import javax.swing.BoxLayout;
+import javax.swing.plaf.UIResource;
+
+/**
+ * The LayoutManager that is used in PopupMenus. This is a derived from
+ * {@link BoxLayout}.
+ *
+ * @author Roman Kennke (roman at kennke.org)
+ */
+public class DefaultMenuLayout
+ extends BoxLayout
+ implements UIResource
+{
+
+ /**
+ * Creates a new instance of DefaultMenuLayout.
+ *
+ * @param target the component that is laid out
+ * @param axis the axis along which the component is laid out
+ */
+ public DefaultMenuLayout(Container target, int axis)
+ {
+ super(target, axis);
+ }
+
+ /**
+ * Returns the preferred size for the layout of the menu.
+ *
+ * @param target the Container which's preferred size we calculate
+ */
+ public Dimension preferredLayoutSize(Container target)
+ {
+ return super.preferredLayoutSize(target);
+ }
+
+}
More information about the kaffe
mailing list