Merged gcj-eclipse branch to trunk.
From-SVN: r120621
This commit is contained in:
@@ -225,6 +225,8 @@ public class CardLayout implements LayoutManager2, Serializable
|
||||
*/
|
||||
public Dimension maximumLayoutSize (Container target)
|
||||
{
|
||||
if (target == null)
|
||||
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
// The JCL says that this returns Integer.MAX_VALUE for both
|
||||
// dimensions. But that just seems wrong to me.
|
||||
return getSize (target, MAX);
|
||||
@@ -361,7 +363,7 @@ public class CardLayout implements LayoutManager2, Serializable
|
||||
*/
|
||||
public String toString ()
|
||||
{
|
||||
return getClass ().getName () + "[" + hgap + "," + vgap + "]";
|
||||
return getClass ().getName () + "[hgap=" + hgap + ",vgap=" + vgap + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -401,11 +403,11 @@ public class CardLayout implements LayoutManager2, Serializable
|
||||
{
|
||||
if (comps[i].isVisible ())
|
||||
{
|
||||
if (what == NEXT)
|
||||
if (choice == i)
|
||||
{
|
||||
choice = i + 1;
|
||||
if (choice == num)
|
||||
choice = 0;
|
||||
// Do nothing if we're already looking at the right
|
||||
// component.
|
||||
return;
|
||||
}
|
||||
else if (what == PREV)
|
||||
{
|
||||
@@ -413,17 +415,20 @@ public class CardLayout implements LayoutManager2, Serializable
|
||||
if (choice < 0)
|
||||
choice = num - 1;
|
||||
}
|
||||
else if (choice == i)
|
||||
else if (what == NEXT)
|
||||
{
|
||||
// Do nothing if we're already looking at the right
|
||||
// component.
|
||||
return;
|
||||
choice = i + 1;
|
||||
if (choice == num)
|
||||
choice = 0;
|
||||
}
|
||||
comps[i].setVisible (false);
|
||||
|
||||
if (choice >= 0)
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
comps[i].setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (choice >= 0 && choice < num)
|
||||
|
||||
Reference in New Issue
Block a user