Imported GNU Classpath 0.90

Imported GNU Classpath 0.90
       * scripts/makemake.tcl: LocaleData.java moved to gnu/java/locale.

       * sources.am: Regenerated.
       * gcj/javaprims.h: Regenerated.
       * Makefile.in: Regenerated.
       * gcj/Makefile.in: Regenerated.
       * include/Makefile.in: Regenerated.
       * testsuite/Makefile.in: Regenerated.

       * gnu/java/lang/VMInstrumentationImpl.java: New override.
       * gnu/java/net/local/LocalSocketImpl.java: Likewise.
       * gnu/classpath/jdwp/VMMethod.java: Likewise.
       * gnu/classpath/jdwp/VMVirtualMachine.java: Update to latest
       interface.
       * java/lang/Thread.java: Add UncaughtExceptionHandler.
       * java/lang/reflect/Method.java: Implements GenericDeclaration and
       isSynthetic(),
       * java/lang/reflect/Field.java: Likewise.
       * java/lang/reflect/Constructor.java
       * java/lang/Class.java: Implements Type, GenericDeclaration,
       getSimpleName() and getEnclosing*() methods.
       * java/lang/Class.h: Add new public methods.
       * java/lang/Math.java: Add signum(), ulp() and log10().
       * java/lang/natMath.cc (log10): New function.
       * java/security/VMSecureRandom.java: New override.
       * java/util/logging/Logger.java: Updated to latest classpath
       version.
       * java/util/logging/LogManager.java: New override.

From-SVN: r113887
This commit is contained in:
Mark Wielaard 2006-05-18 17:29:21 +00:00
parent eaec4980e1
commit 4f9533c772
1640 changed files with 126485 additions and 104808 deletions

View file

@ -38,6 +38,8 @@ exception statement from your version. */
package java.awt;
import gnu.classpath.NotImplementedException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
@ -323,6 +325,7 @@ public class GridBagLayout
* Obsolete.
*/
protected void AdjustForGravity (GridBagConstraints gbc, Rectangle rect)
throws NotImplementedException
{
// FIXME
throw new Error ("Not implemented");
@ -349,107 +352,121 @@ public class GridBagLayout
// be invalidated, clearing the layout information cache,
// layoutInfo. So we wait until after this for loop to set
// layoutInfo.
for(int i = 0; i < components.length; i++)
{
Component component = components [i];
// If component is not visible we dont have to care about it.
if (!component.isVisible())
continue;
GridBagConstraints constraints =
lookupInternalConstraints(component);
Component lastComp = null;
int cellx = 0;
int celly = 0;
int cellw = 0;
int cellh = 0;
for (int i = 0; i < components.length; i++)
{
Component component = components[i];
int cellx = sumIntArray(info.colWidths, constraints.gridx);
int celly = sumIntArray(info.rowHeights, constraints.gridy);
int cellw = sumIntArray(info.colWidths,
constraints.gridx + constraints.gridwidth) - cellx;
int cellh = sumIntArray(info.rowHeights,
constraints.gridy + constraints.gridheight) - celly;
// If component is not visible we dont have to care about it.
if (! component.isVisible())
continue;
Insets insets = constraints.insets;
if (insets != null)
{
cellx += insets.left;
celly += insets.top;
cellw -= insets.left + insets.right;
cellh -= insets.top + insets.bottom;
}
Dimension dim = component.getPreferredSize();
GridBagConstraints constraints = lookupInternalConstraints(component);
if (lastComp != null
&& constraints.gridheight == GridBagConstraints.REMAINDER)
celly += cellh;
else
celly = sumIntArray(info.rowHeights, constraints.gridy);
if (lastComp != null
&& constraints.gridwidth == GridBagConstraints.REMAINDER)
cellx += cellw;
else
cellx = sumIntArray(info.colWidths, constraints.gridx);
Dimension dim = component.getPreferredSize();
cellw = sumIntArray(info.colWidths, constraints.gridx
+ constraints.gridwidth) - cellx;
cellh = sumIntArray(info.rowHeights, constraints.gridy
+ constraints.gridheight) - celly;
Insets insets = constraints.insets;
if (insets != null)
{
cellx += insets.left;
celly += insets.top;
cellw -= insets.left + insets.right;
cellh -= insets.top + insets.bottom;
}
// Note: Documentation says that padding is added on both sides, but
// visual inspection shows that the Sun implementation only adds it
// once, so we do the same.
dim.width += constraints.ipadx;
dim.height += constraints.ipady;
// Note: Documentation says that padding is added on both sides, but
// visual inspection shows that the Sun implementation only adds it
// once, so we do the same.
dim.width += constraints.ipadx;
dim.height += constraints.ipady;
switch(constraints.fill)
{
case GridBagConstraints.HORIZONTAL:
dim.width = cellw;
break;
case GridBagConstraints.VERTICAL:
dim.height = cellh;
break;
case GridBagConstraints.BOTH:
dim.width = cellw;
dim.height = cellh;
break;
}
switch (constraints.fill)
{
case GridBagConstraints.HORIZONTAL:
dim.width = cellw;
break;
case GridBagConstraints.VERTICAL:
dim.height = cellh;
break;
case GridBagConstraints.BOTH:
dim.width = cellw;
dim.height = cellh;
break;
}
int x;
int y;
int x = 0;
int y = 0;
switch(constraints.anchor)
{
case GridBagConstraints.NORTH:
x = cellx + (cellw - dim.width) / 2;
y = celly;
break;
case GridBagConstraints.SOUTH:
x = cellx + (cellw - dim.width) / 2;
y = celly + cellh - dim.height;
break;
case GridBagConstraints.WEST:
x = cellx;
y = celly + (cellh - dim.height) / 2;
break;
case GridBagConstraints.EAST:
x = cellx + cellw - dim.width;
y = celly + (cellh - dim.height) / 2;
break;
case GridBagConstraints.NORTHEAST:
x = cellx + cellw - dim.width;
y = celly;
break;
case GridBagConstraints.NORTHWEST:
x = cellx;
y = celly;
break;
case GridBagConstraints.SOUTHEAST:
x = cellx + cellw - dim.width;
y = celly + cellh - dim.height;
break;
case GridBagConstraints.SOUTHWEST:
x = cellx;
y = celly + cellh - dim.height;
break;
default:
x = cellx + (cellw - dim.width) / 2;
y = celly + (cellh - dim.height) / 2;
break;
}
switch (constraints.anchor)
{
case GridBagConstraints.NORTH:
x = cellx + (cellw - dim.width) / 2;
y = celly;
break;
case GridBagConstraints.SOUTH:
x = cellx + (cellw - dim.width) / 2;
y = celly + cellh - dim.height;
break;
case GridBagConstraints.WEST:
x = cellx;
y = celly + (cellh - dim.height) / 2;
break;
case GridBagConstraints.EAST:
x = cellx + cellw - dim.width;
y = celly + (cellh - dim.height) / 2;
break;
case GridBagConstraints.NORTHEAST:
x = cellx + cellw - dim.width;
y = celly;
break;
case GridBagConstraints.NORTHWEST:
x = cellx;
y = celly;
break;
case GridBagConstraints.SOUTHEAST:
x = cellx + cellw - dim.width;
y = celly + cellh - dim.height;
break;
case GridBagConstraints.SOUTHWEST:
x = cellx;
y = celly + cellh - dim.height;
break;
default:
x = cellx + (cellw - dim.width) / 2;
y = celly + (cellh - dim.height) / 2;
break;
}
component.setBounds(info.pos_x + x, info.pos_y + y, dim.width,
dim.height);
lastComp = component;
}
component.setBounds(info.pos_x + x, info.pos_y + y, dim.width, dim.height);
}
// DEBUG
//dumpLayoutInfo(info);
// DEBUG
//dumpLayoutInfo (info);
// Cache layout information.
layoutInfo = getLayoutInfo (parent, PREFERREDSIZE);
}
// Cache layout information.
layoutInfo = getLayoutInfo(parent, PREFERREDSIZE);
}
/**
* Obsolete.
@ -485,11 +502,10 @@ public class GridBagLayout
for (int i = 0; i < components.length; i++)
{
Component component = components [i];
// If component is not visible we dont have to care about it.
if (!component.isVisible())
continue;
// When looking up the constraint for the first time, check the
// original unmodified constraint. After the first time, always
// refer to the internal modified constraint.
@ -516,7 +532,6 @@ public class GridBagLayout
//
// nothing to check; just add it
// cases 1 and 2
if(constraints.gridx == GridBagConstraints.RELATIVE)
{
@ -560,7 +575,9 @@ public class GridBagLayout
// this column. We want to add this component below it.
// If this column is empty, add to the 0 position.
if (!lastInCol.containsKey(new Integer(constraints.gridx)))
y = 0;
{
y = current_y;
}
else
{
Component lastComponent = (Component)lastInCol.get(new Integer(constraints.gridx));
@ -596,7 +613,7 @@ public class GridBagLayout
// Update our reference points for RELATIVE gridx and gridy.
if(constraints.gridwidth == GridBagConstraints.REMAINDER)
{
current_y = constraints.gridy + Math.max(1, constraints.gridheight);
current_y = constraints.gridy + Math.max(1, constraints.gridheight);
}
else if (constraints.gridwidth != GridBagConstraints.REMAINDER)
{
@ -788,7 +805,7 @@ public class GridBagLayout
height += constraints.insets.top + constraints.insets.bottom;
height += constraints.ipady;
distributeSizeAndWeight(height,
constraints.weighty,
constraints.gridy,
@ -918,7 +935,7 @@ public class GridBagLayout
sizes[start] = Math.max(sizes[start], size);
weights[start] = Math.max(weights[start], weight);
}
else if (span > 1)
else
{
int numOccupied = span;
int lastOccupied = -1;