[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: LayeredPane fixes from gcj gui branch
From: |
Mark Wielaard |
Subject: |
[cp-patches] FYI: LayeredPane fixes from gcj gui branch |
Date: |
Sun, 08 Aug 2004 14:49:17 +0200 |
Hi,
This merges some fixes for bugs in the layered pane, and also throws in
a minor improvement to Box.java. This was in response to PR SWING/16576.
http://gcc.gnu.org/PR16576
2004-08-08 Graydon Hoare <address@hidden>
PR SWING/16576
* javax/swing/JLayeredPane.java
(setLayer): Permit changing layer after addition.
(setPosition): Permit over-length positions.
(layerToRange): Compare intValue()s.
* javax/swing/Box.java (createHorizontalBox): Implement.
(createRigidArea): Likewise.
(createVerticalBox): Likewise.
Committed.
Cheers,
Mark
--- javax/swing/Box.java 30 Jul 2004 21:34:34 -0000 1.3.2.9
+++ javax/swing/Box.java 4 Aug 2004 04:15:34 -0000
@@ -198,7 +198,7 @@
public static Box createHorizontalBox()
{
- return null;
+ return new Box(BoxLayout.X_AXIS);
}
/**
@@ -231,12 +231,12 @@
public static Component createRigidArea(Dimension d)
{
- return null;
+ return new Filler(d, d, d);
}
public static Box createVerticalBox()
{
- return null;
+ return new Box(BoxLayout.Y_AXIS);
}
/**
--- javax/swing/JLayeredPane.java 14 Jun 2004 14:16:57 -0000 1.6.8.4
+++ javax/swing/JLayeredPane.java 4 Aug 2004 04:15:35 -0000
@@ -153,7 +153,7 @@
Map.Entry pair = (Map.Entry) i.next();
Integer layerNum = (Integer) pair.getKey ();
Integer layerSz = (Integer) pair.getValue ();
- if (layerNum == layer)
+ if (layerNum.intValue() == layer.intValue())
{
ret[0] = ret[1] - layerSz.intValue ();
return ret;
@@ -314,7 +314,7 @@
int bot = range[1];
if (position == -1)
position = (bot - top) - 1;
- int targ = top + position;
+ int targ = Math.min(top + position, bot-1);
int curr = -1;
Component[] comps = getComponents();
@@ -539,7 +539,8 @@
int layer,
int position)
{
- componentToLayer.put (c, getObjectForLayer (layer));
+ remove(c);
+ add(c, getObjectForLayer (layer));
setPosition(c, position);
revalidate();
repaint();
signature.asc
Description: This is a digitally signed message part
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: LayeredPane fixes from gcj gui branch,
Mark Wielaard <=