diff options
author | Mark Wielaard <mark@klomp.org> | 2006-05-15 09:45:33 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2006-05-15 09:45:33 +0000 |
commit | 5e8704b0f93bf54154dac38e3cbef50436127424 (patch) | |
tree | 2d2be2e65703cccfba1a2b9fd7b289f98ea46983 | |
parent | 940e4db75683240c9a097b812e973e1009ab56c4 (diff) | |
download | classpath-5e8704b0f93bf54154dac38e3cbef50436127424.tar.gz |
2006-05-15 Mark Wielaard <mark@klomp.org>generics-0_91-release
* configure.ac (VERSION): Set to 0.91-generics.
2006-05-15 Mark Wielaard <mark@klomp.org>
* NEWS: Add release date and VMClassLoader.getBootPackages()
changes.
2006-05-15 Christian Thalinger <twisti@complang.tuwien.ac.at>
* README: Added CACAO to list of VMs.
2006-05-14 Mark Wielaard <mark@klomp.org>
* native/jni/java-net/javanet.c (_javanet_accept): Don't use C++
comments.
2006-05-14 Chris Burdess <dog@gnu.org>
* gnu/xml/dom/DomNode.java: Permit comments and PIs in doctype
nodes to be preserved during cloneNode.
2006-05-14 Mark Wielaard <mark@klomp.org>
PR 27459
* native/jni/java-net/javanet.c (_javanet_accept): Reset the
inherited timeout on socket.
2006-05-14 Lillian Angel <langel@redhat.com>
* java/util/SimpleTimeZone.java: Reverted patch.
(SimpleTimeZone): Throw exception if startMonth ==
endMonth.
(SimpleTimeZone): Likewise.
(checkRule): Rewritten to properly check all values (more
efficently).
This code is now more stable, at least less buggy than before.
Fixed API documentation.
(setStartRule): Moved checkRule call to end.
(setStartRule): Likewise.
(setEndRule): Likewise.
(setEndRule): Likewise.
2006-05-14 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* javax/swing/tree/DefaultTreeSelectionModel.java (leadRow):
Initialise to -1.
2006-05-14 Robert Schuster <robertschuster@fsfe.org>
PR classpath/27595
* javax/swing/text/AbstractDocument.java:
(insertString): Flipped if-expression and its blocks.
(remove): Dito.
(replace): Flipped if-expression and its blocks, added note, invoke
insertString and remove instead of insertStringImpl and removeImpl.
2006-05-13 Tom Tromey <tromey@redhat.com>
* java/nio/ByteBufferImpl.java (compact): Always set position.
2006-05-11 Mark Wielaard <mark@klomp.org>
* java/util/logging/Logger.java (global): Initialize inside static
PrivilegedAction.
2006-05-11 Mark Wielaard <mark@klomp.org>
* java/awt/geom/GeneralPath.java (WIND_EVEN_ODD, WIND_NON_ZERO):
Fully qualify PathIterator constants
2006-05-10 Roman Kennke <kennke@aicas.com>
PR classpath/27481
* javax/swing/plaf/basic/BasicInternalFrameUI.java
(installDefaults): Set background of content pane to null, if
no custom color has been installed by the application yet.
2006-05-10 Roman Kennke <kennke@aicas.com>
PR classpath/27481
* javax/swing/JRootPane.java
(createContentPane): Don't set background to null.
2006-05-09 Robert Schuster <robertschuster@fsfe.org>
PR classpath/24216
* javax/swing/text/AbstractDocument.java:
(insertString): Added more documentation, added argument check.
(remove): Added more documentation.
(removeImpl): Added argument check.
(replace): Added more documentation, added argument check.
2006-05-08 Lillian Angel <langel@redhat.com>
* java/net/URLClassLoader.java
(JarURLLoader): Added check to make sure the INDEX.LIST file
exists.
2006-05-08 Roman Kennke <kennke@aicas.com>
PR classpath/27481
* javax/swing/JRootPane.java
(createContentPane): Set background of the content pane to null,
so that the content pane inherits its background from the
root pane.
2006-05-08 Roman Kennke <kennke@aicas.com>
PR classpath/27480
* javax/swing/ButtonGroup.java
(add): Check if new button is selected and if so, deselect other
buttons in the group.
2006-05-08 Lillian Angel <langel@redhat.com>
PR 27444
* java/net/URLClassLoader.java
(JarURLLoader): Added code to go through
META-INF/INDEX.LIST file to load all jars listed.
2006-05-08 Roman Kennke <kennke@aicas.com>
PR classpath/27461
* javax/swing/ImageIcon.java
(ImageIcon(URL)): Set description to URL.toString().
2006-05-08 Roman Kennke <kennke@aicas.com>
PR classpath/27482
* javax/swing/JTable.java
(IconCellRenderer.getTableCellRendererComponent): Set icon to
null when cell value is null.
2006-05-08 Roman Kennke <kennke@aicas.com>
PR classpath/27484
* javax/swing/DefaultDesktopManager.java
(closeFrame): Don't perform default close action on the frame
to prevent endless loop.
2006-05-08 Roman Kennke <kennke@aicas.com>
PR classpath/27485
* javax/swing/table/DefaultTableModel.java
(addExtraRows): New helper method.
(checkSize): New helper method.
(setRowCount): Use addExtraRows helper method.
(addColumn): Use addExtraRows helper method.
(getColumnName): Check and adjust size if necessary using
checkSize().
2006-05-08 Roman Kennke <kennke@aicas.com>
PR classpath/27486
* javax/swing/JTable.java
(setValueAt): Allow setting values even when table is editable.
2006-05-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/27435:
* java/util/zip/DeflaterEngine.java:
(deflateFast(boolean,boolean)): Empty buffer when full.
2006-05-07 Sven de Marothy <sven@physto.se>
Fixed PR27343
* java/util/Calendar.java (setTimeZone): Force recalculation.
2006-05-07 Sven de Marothy <sven@physto.se>
Fixed PR27463
* javax/swing/plaf/metal/MetalInternalFrameTitlePane.java
(propertyChange): Handle FRAME_ICON_PROPERTY property.
2006-05-06 Sven de Marothy <sven@physto.se>
Fixed PR27454
* gnu/java/awt/peer/gtk/GtkImage: (drawPixels,drawPixelsScaled):
Check for zero image sizes.
2006-05-07 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/27311:
* gnu/java/text/StringFormatBuffer.java:
(toString()): Implemented so we can see the contents.
* java/text/DecimalFormat.java:
(formatInternal(double,StringFormatBuffer,FieldPosition)):
Don't calculate the exponent when the number is 0 or less.
Also, use log10 instead of log now it's available.
2006-05-07 Sven de Marothy <sven@physto.se>
Fixed PR27455
* gnu/java/awt/peer/GLightweightPeer.java (mouseEntered): Remove.
* java/awt/Component.java (processMouseEvent):
Do lightweight cursor handling.
* javax/swing/plaf/basic/BasicTableHeaderUI.java
(endResizing,mouseMoved): Save and reset original cursor, not the
default one.
2006-05-07 Roman Kennke <kennke@aicas.com>
* gnu/java/awt/java2d/RasterGraphics.java: New file.
2006-05-07 Roman Kennke <kennke@aicas.com>
* gnu/java/awt/java2d/AbstractGraphics2D.java
(fillShape): Determine user space bounds of shape and feed them
into the actual rendering pipeline.
(rawSetPixel): Made non-abstract for now. Maybe remove later.
(rawSetForeground): Likewise.
(getDestinationColorModel): Removed.
(getDeviceBounds): Made non-abstract. Provide useful default impl.
(rawFillShape): Handle paint context.
(fillScanline): Implement painting and compositing.
(fillShapeAntialias): Handle paint context.
(fillScanlineAA): Implemented preliminary antialiasing based on
composite context. Not working yet.
(fillScanlineAlpha): Removed.
(init): Fetch destination raster.
(getDestinationRaster): New abstract method.
(updateRaster): New backend method.
2006-05-07 Roman Kennke <kennke@aicas.com>
* gnu/java/awt/java2d/AlphaCompositeContext.java
(compose): Fixed loops, conditions and logic to make compositing
work correctly.
2006-05-05 Roman Kennke <kennke@aicas.com>
* java/awt/image/ColorModel.java
(getNormalizedComponents): Implemented.
2006-05-05 Roman Kennke <kennke@aicas.com>
* javax/swing/plaf/basic/BasicRadioButtonUI.java
(paint): Query the button model for it's state, not the
button itself.
2006-05-05 Roman Kennke <kennke@aicas.com>
* javax/swing/JTable.java
(tableChanged): Sync selection model with table model changes.
2006-05-04 Roman Kennke <kennke@aicas.com>
* javax/swing/plaf/basic/BasicButtonListener.java
(mouseEntered): Fixed conditions for changing states.
2006-05-04 Roman Kennke <kennke@aicas.com>
* javax/swing/JOptionPane.java
(AccessibleJOptionPane.getAccessibleRole): Implemented method.
2006-05-04 Roman Kennke <kennke@aicas.com>
* javax/swing/JLabel.java
(AccessibleJLabel.getSelectedText): Return null instead of "".
(AccessibleJLabel.getSelectionStart): Added comment why
return -1 is correct here.
(AccessibleJLabel.getSelectionEnd): Added comment why
return -1 is correct here.
(AccessibleJLabel.getCharacterAttribute): Added comment about
what to do here.
(AccessibleJLabel.getCharCount): Added comment about what
to do here.
(AccessibleJLabel.getCharacterBounds): Tagged as not
implemented.
(AccessibleJLabel.getIndexAtPoint): Tagged as not implemented.
(paramString): Return super.paramString() here, this provides
a more meaningful output.
2006-05-04 Roman Kennke <kennke@aicas.com>
* javax/swing/JComponent.java
(paint): Added null check to avoid NPE when clip == null.
2006-05-04 Roman Kennke <kennke@aicas.com>
* javax/swing/AbstractButton.java
(addImpl): New method. Installs an OverlayLayout if no
other layout has been installed before.
(setLayout): New method. Detect if a client app installs a
custom layout.
2006-05-04 Roman Kennke <kennke@aicas.com>
* javax/swing/table/DefaultTableCellModel.java
(noFocusBorder): Fixed width of empty border to 1.
(getTableCellRendererComponent): Don't change the colors for
focuses cells. Fixed border for focused cells.
2006-05-04 Roman Kennke <kennke@aicas.com>
* javax/swing/JTable.java
(moveToCellBeingEdited): Adjust bounding box
of editing component to exactly cover the grid.
* javax/swing/plaf/basic/BasicTableUI.java
(paint): Paint grid to the bottom and right of
the cells instead of left and top. Adjust bounding
box of cells accordingly.
* javax/swing/plaf/metal/MetalLookAndFeel.java
(initComponentDefaults): Fixed color of JTable
selection border.
* javax/swing/plaf/metal/OceanTheme.java
(addCustomEntriesToTable): Fixed color of JTable
selection border.
2006-05-04 Raif S. Naffah <raif@swiftdsl.com.au>
* tools/gnu/classpath/tools/keytool/ExportCmd.java (setup):
Use _alias instead of alias.
2006-05-04 Lillian Angel <langel@redhat.com>
* javax/swing/JLabel.java
(JLabel): Pass in an empty string for the text parameter.
(JLabel): Likewise.
(JLabel): Likewise.
2006-05-05 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* javax/swing/plaf/basic/BasicTreeUI.java (paint): Return early
if there are no visible nodes to paint.
43 files changed, 898 insertions, 318 deletions
@@ -1,3 +1,331 @@ +2006-05-15 Mark Wielaard <mark@klomp.org> + + * configure.ac (VERSION): Set to 0.91-generics. + +2006-05-15 Mark Wielaard <mark@klomp.org> + + * NEWS: Add release date and VMClassLoader.getBootPackages() + changes. + +2006-05-15 Christian Thalinger <twisti@complang.tuwien.ac.at> + + * README: Added CACAO to list of VMs. + +2006-05-14 Mark Wielaard <mark@klomp.org> + + * native/jni/java-net/javanet.c (_javanet_accept): Don't use C++ + comments. + +2006-05-14 Chris Burdess <dog@gnu.org> + + * gnu/xml/dom/DomNode.java: Permit comments and PIs in doctype + nodes to be preserved during cloneNode. + +2006-05-14 Mark Wielaard <mark@klomp.org> + + PR 27459 + * native/jni/java-net/javanet.c (_javanet_accept): Reset the + inherited timeout on socket. + +2006-05-14 Lillian Angel <langel@redhat.com> + + * java/util/SimpleTimeZone.java: Reverted patch. + (SimpleTimeZone): Throw exception if startMonth == + endMonth. + (SimpleTimeZone): Likewise. + (checkRule): Rewritten to properly check all values (more + efficently). + This code is now more stable, at least less buggy than before. + Fixed API documentation. + (setStartRule): Moved checkRule call to end. + (setStartRule): Likewise. + (setEndRule): Likewise. + (setEndRule): Likewise. + +2006-05-14 Audrius Meskauskas <AudriusA@Bioinformatics.org> + + * javax/swing/tree/DefaultTreeSelectionModel.java (leadRow): + Initialise to -1. + +2006-05-14 Robert Schuster <robertschuster@fsfe.org> + + PR classpath/27595 + * javax/swing/text/AbstractDocument.java: + (insertString): Flipped if-expression and its blocks. + (remove): Dito. + (replace): Flipped if-expression and its blocks, added note, invoke + insertString and remove instead of insertStringImpl and removeImpl. + +2006-05-13 Tom Tromey <tromey@redhat.com> + + * java/nio/ByteBufferImpl.java (compact): Always set position. + +2006-05-11 Mark Wielaard <mark@klomp.org> + + * java/util/logging/Logger.java (global): Initialize inside static + PrivilegedAction. + +2006-05-11 Mark Wielaard <mark@klomp.org> + + * java/awt/geom/GeneralPath.java (WIND_EVEN_ODD, WIND_NON_ZERO): + Fully qualify PathIterator constants + +2006-05-10 Roman Kennke <kennke@aicas.com> + + PR classpath/27481 + * javax/swing/plaf/basic/BasicInternalFrameUI.java + (installDefaults): Set background of content pane to null, if + no custom color has been installed by the application yet. + +2006-05-10 Roman Kennke <kennke@aicas.com> + + PR classpath/27481 + * javax/swing/JRootPane.java + (createContentPane): Don't set background to null. + +2006-05-09 Robert Schuster <robertschuster@fsfe.org> + + PR classpath/24216 + * javax/swing/text/AbstractDocument.java: + (insertString): Added more documentation, added argument check. + (remove): Added more documentation. + (removeImpl): Added argument check. + (replace): Added more documentation, added argument check. + +2006-05-08 Lillian Angel <langel@redhat.com> + + * java/net/URLClassLoader.java + (JarURLLoader): Added check to make sure the INDEX.LIST file + exists. + +2006-05-08 Roman Kennke <kennke@aicas.com> + + PR classpath/27481 + * javax/swing/JRootPane.java + (createContentPane): Set background of the content pane to null, + so that the content pane inherits its background from the + root pane. + +2006-05-08 Roman Kennke <kennke@aicas.com> + + PR classpath/27480 + * javax/swing/ButtonGroup.java + (add): Check if new button is selected and if so, deselect other + buttons in the group. + +2006-05-08 Lillian Angel <langel@redhat.com> + + PR 27444 + * java/net/URLClassLoader.java + (JarURLLoader): Added code to go through + META-INF/INDEX.LIST file to load all jars listed. + +2006-05-08 Roman Kennke <kennke@aicas.com> + + PR classpath/27461 + * javax/swing/ImageIcon.java + (ImageIcon(URL)): Set description to URL.toString(). + +2006-05-08 Roman Kennke <kennke@aicas.com> + + PR classpath/27482 + * javax/swing/JTable.java + (IconCellRenderer.getTableCellRendererComponent): Set icon to + null when cell value is null. + +2006-05-08 Roman Kennke <kennke@aicas.com> + + PR classpath/27484 + * javax/swing/DefaultDesktopManager.java + (closeFrame): Don't perform default close action on the frame + to prevent endless loop. + +2006-05-08 Roman Kennke <kennke@aicas.com> + + PR classpath/27485 + * javax/swing/table/DefaultTableModel.java + (addExtraRows): New helper method. + (checkSize): New helper method. + (setRowCount): Use addExtraRows helper method. + (addColumn): Use addExtraRows helper method. + (getColumnName): Check and adjust size if necessary using + checkSize(). + +2006-05-08 Roman Kennke <kennke@aicas.com> + + PR classpath/27486 + * javax/swing/JTable.java + (setValueAt): Allow setting values even when table is editable. + +2006-05-07 Andrew John Hughes <gnu_andrew@member.fsf.org> + + PR classpath/27435: + * java/util/zip/DeflaterEngine.java: + (deflateFast(boolean,boolean)): Empty buffer when full. + +2006-05-07 Sven de Marothy <sven@physto.se> + + Fixed PR27343 + * java/util/Calendar.java (setTimeZone): Force recalculation. + +2006-05-07 Sven de Marothy <sven@physto.se> + + Fixed PR27463 + * javax/swing/plaf/metal/MetalInternalFrameTitlePane.java + (propertyChange): Handle FRAME_ICON_PROPERTY property. + +2006-05-06 Sven de Marothy <sven@physto.se> + + Fixed PR27454 + * gnu/java/awt/peer/gtk/GtkImage: (drawPixels,drawPixelsScaled): + Check for zero image sizes. + +2006-05-07 Andrew John Hughes <gnu_andrew@member.fsf.org> + + PR classpath/27311: + * gnu/java/text/StringFormatBuffer.java: + (toString()): Implemented so we can see the contents. + * java/text/DecimalFormat.java: + (formatInternal(double,StringFormatBuffer,FieldPosition)): + Don't calculate the exponent when the number is 0 or less. + Also, use log10 instead of log now it's available. + +2006-05-07 Sven de Marothy <sven@physto.se> + + Fixed PR27455 + * gnu/java/awt/peer/GLightweightPeer.java (mouseEntered): Remove. + * java/awt/Component.java (processMouseEvent): + Do lightweight cursor handling. + * javax/swing/plaf/basic/BasicTableHeaderUI.java + (endResizing,mouseMoved): Save and reset original cursor, not the + default one. + +2006-05-07 Roman Kennke <kennke@aicas.com> + + * gnu/java/awt/java2d/RasterGraphics.java: New file. + +2006-05-07 Roman Kennke <kennke@aicas.com> + + * gnu/java/awt/java2d/AbstractGraphics2D.java + (fillShape): Determine user space bounds of shape and feed them + into the actual rendering pipeline. + (rawSetPixel): Made non-abstract for now. Maybe remove later. + (rawSetForeground): Likewise. + (getDestinationColorModel): Removed. + (getDeviceBounds): Made non-abstract. Provide useful default impl. + (rawFillShape): Handle paint context. + (fillScanline): Implement painting and compositing. + (fillShapeAntialias): Handle paint context. + (fillScanlineAA): Implemented preliminary antialiasing based on + composite context. Not working yet. + (fillScanlineAlpha): Removed. + (init): Fetch destination raster. + (getDestinationRaster): New abstract method. + (updateRaster): New backend method. + +2006-05-07 Roman Kennke <kennke@aicas.com> + + * gnu/java/awt/java2d/AlphaCompositeContext.java + (compose): Fixed loops, conditions and logic to make compositing + work correctly. + +2006-05-05 Roman Kennke <kennke@aicas.com> + + * java/awt/image/ColorModel.java + (getNormalizedComponents): Implemented. + +2006-05-05 Roman Kennke <kennke@aicas.com> + + * javax/swing/plaf/basic/BasicRadioButtonUI.java + (paint): Query the button model for it's state, not the + button itself. + +2006-05-05 Roman Kennke <kennke@aicas.com> + + * javax/swing/JTable.java + (tableChanged): Sync selection model with table model changes. + +2006-05-04 Roman Kennke <kennke@aicas.com> + + * javax/swing/plaf/basic/BasicButtonListener.java + (mouseEntered): Fixed conditions for changing states. + +2006-05-04 Roman Kennke <kennke@aicas.com> + + * javax/swing/JOptionPane.java + (AccessibleJOptionPane.getAccessibleRole): Implemented method. + +2006-05-04 Roman Kennke <kennke@aicas.com> + + * javax/swing/JLabel.java + (AccessibleJLabel.getSelectedText): Return null instead of "". + (AccessibleJLabel.getSelectionStart): Added comment why + return -1 is correct here. + (AccessibleJLabel.getSelectionEnd): Added comment why + return -1 is correct here. + (AccessibleJLabel.getCharacterAttribute): Added comment about + what to do here. + (AccessibleJLabel.getCharCount): Added comment about what + to do here. + (AccessibleJLabel.getCharacterBounds): Tagged as not + implemented. + (AccessibleJLabel.getIndexAtPoint): Tagged as not implemented. + (paramString): Return super.paramString() here, this provides + a more meaningful output. + +2006-05-04 Roman Kennke <kennke@aicas.com> + + * javax/swing/JComponent.java + (paint): Added null check to avoid NPE when clip == null. + +2006-05-04 Roman Kennke <kennke@aicas.com> + + * javax/swing/AbstractButton.java + (addImpl): New method. Installs an OverlayLayout if no + other layout has been installed before. + (setLayout): New method. Detect if a client app installs a + custom layout. + +2006-05-04 Roman Kennke <kennke@aicas.com> + + * javax/swing/table/DefaultTableCellModel.java + (noFocusBorder): Fixed width of empty border to 1. + (getTableCellRendererComponent): Don't change the colors for + focuses cells. Fixed border for focused cells. + +2006-05-04 Roman Kennke <kennke@aicas.com> + + * javax/swing/JTable.java + (moveToCellBeingEdited): Adjust bounding box + of editing component to exactly cover the grid. + * javax/swing/plaf/basic/BasicTableUI.java + (paint): Paint grid to the bottom and right of + the cells instead of left and top. Adjust bounding + box of cells accordingly. + * javax/swing/plaf/metal/MetalLookAndFeel.java + (initComponentDefaults): Fixed color of JTable + selection border. + * javax/swing/plaf/metal/OceanTheme.java + (addCustomEntriesToTable): Fixed color of JTable + selection border. + +2006-05-04 Raif S. Naffah <raif@swiftdsl.com.au> + + * tools/gnu/classpath/tools/keytool/ExportCmd.java (setup): + Use _alias instead of alias. + +2006-05-04 Lillian Angel <langel@redhat.com> + + * javax/swing/JLabel.java + (JLabel): Pass in an empty string for the text parameter. + (JLabel): Likewise. + (JLabel): Likewise. + +2006-05-05 Audrius Meskauskas <AudriusA@Bioinformatics.org> + + * javax/swing/plaf/basic/BasicTreeUI.java (paint): Return early + if there are no visible nodes to paint. + 2006-05-03 Andrew John Hughes <gnu_andrew@member.fsf.org> * include/Makefile.am: @@ -1,4 +1,4 @@ -New in release 0.91 (UNRELEASED) +New in release 0.91 (May 15, 2006) * Experimental activation (java.rmi.activation) support, including RMI activation daemon and persistent naming service tools. @@ -58,6 +58,9 @@ Runtime interface changes: * java.lang.Package now has a new constructor that takes the defining ClassLoader as an extra argument. If you use a custom version of VMClassLoader, please switch it to use this constructor. +* The reference implementation of VMClassLoader.getBootPackages() now + reads the META-INF/INDEX.LIST resource using the java.boot.class.path + system property. New in release 0.90 (March 6, 2006) @@ -1,4 +1,4 @@ -GNU Classpath README - Last updated: August 31, 2005 +GNU Classpath README - Last updated: May 15, 2006 GNU Classpath, Essential Libraries for Java is a project to create a free software implementation of the core class libraries for the java @@ -29,6 +29,7 @@ Smaller environments (runtime only, no compilers, no tools) which work with this GNU Classpath releases include (tested by and recommended for GNU Classpath hackers): + * CACAO (http://www.cacaojvm.org/) * JamVM (http://jamvm.sourceforge.net/) * Jikes RVM (http://www.ibm.com/developerworks/oss/jikesrvm/) * Kissme (http://kissme.sourceforge.net/) diff --git a/configure.ac b/configure.ac index 136d8b249..60348845b 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl ----------------------------------------------------------- dnl define([AC_CACHE_LOAD], )dnl dnl define([AC_CACHE_SAVE], )dnl -AC_INIT([GNU Classpath],[0.91-pre-generics],[classpath@gnu.org],[classpath]) +AC_INIT([GNU Classpath],[0.91-generics],[classpath@gnu.org],[classpath]) AC_CONFIG_SRCDIR(java/lang/System.java) AC_CANONICAL_TARGET diff --git a/gnu/java/awt/java2d/AbstractGraphics2D.java b/gnu/java/awt/java2d/AbstractGraphics2D.java index 845c2206e..c2a5ac4be 100644 --- a/gnu/java/awt/java2d/AbstractGraphics2D.java +++ b/gnu/java/awt/java2d/AbstractGraphics2D.java @@ -42,12 +42,14 @@ import java.awt.AlphaComposite; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Composite; +import java.awt.CompositeContext; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Paint; +import java.awt.PaintContext; import java.awt.Polygon; import java.awt.Rectangle; import java.awt.RenderingHints; @@ -73,6 +75,7 @@ import java.awt.image.ColorModel; import java.awt.image.ImageObserver; import java.awt.image.Raster; import java.awt.image.RenderedImage; +import java.awt.image.WritableRaster; import java.awt.image.renderable.RenderableImage; import java.text.AttributedCharacterIterator; import java.util.ArrayList; @@ -148,6 +151,12 @@ public abstract class AbstractGraphics2D private int[] pixel; /** + * The raster of the destination surface. This is where the painting is + * performed. + */ + private WritableRaster destinationRaster; + + /** * Stores the alpha values for a scanline in the anti-aliasing shape * renderer. */ @@ -1155,6 +1164,8 @@ public abstract class AbstractGraphics2D antialias = (v == RenderingHints.VALUE_ANTIALIAS_ON); } + Rectangle2D userBounds = s.getBounds2D(); + // Flatten the path. TODO: Determine the best flattening factor // wrt to speed and quality. PathIterator path = s.getPathIterator(getTransform(), 1.0); @@ -1211,9 +1222,9 @@ public abstract class AbstractGraphics2D if (segs.size() > 0) { if (antialias) - fillShapeAntialias(segs, minX, minY, maxX, maxY); + fillShapeAntialias(segs, minX, minY, maxX, maxY, userBounds); else - rawFillShape(segs, minX, minY, maxX, maxY); + rawFillShape(segs, minX, minY, maxX, maxY, userBounds); } } @@ -1244,14 +1255,20 @@ public abstract class AbstractGraphics2D * @param x the x coordinate * @param y the y coordinate */ - protected abstract void rawSetPixel(int x, int y); + protected void rawSetPixel(int x, int y) + { + // FIXME: Provide default implementation or remove method. + } /** * Sets the foreground color for drawing. * * @param c the color to set */ - protected abstract void rawSetForeground(Color c); + protected void rawSetForeground(Color c) + { + // Probably remove method. + } protected void rawSetForeground(int r, int g, int b) { @@ -1266,18 +1283,14 @@ public abstract class AbstractGraphics2D protected abstract ColorModel getColorModel(); /** - * Returns the color model of the target device. - * - * @return the color model of the target device - */ - protected abstract ColorModel getDestinationColorModel(); - - /** * Returns the bounds of the target. * * @return the bounds of the target */ - protected abstract Rectangle getDeviceBounds(); + protected Rectangle getDeviceBounds() + { + return destinationRaster.getBounds(); + } /** * Returns the bounds of the drawing area in user space. @@ -1392,7 +1405,7 @@ public abstract class AbstractGraphics2D * The polygon is already clipped when this method is called. */ protected void rawFillShape(ArrayList segs, double minX, double minY, - double maxX, double maxY) + double maxX, double maxY, Rectangle2D userBounds) { // This is an implementation of a polygon scanline conversion algorithm // described here: @@ -1400,6 +1413,13 @@ public abstract class AbstractGraphics2D // Create table of all edges. // The edge buckets, sorted and indexed by their Y values. + + Rectangle deviceBounds = new Rectangle((int) minX, (int) minY, + (int) Math.ceil(maxX) - (int) minX, + (int) Math.ceil(maxY) - (int) minY); + PaintContext pCtx = paint.createContext(getColorModel(), deviceBounds, + userBounds, transform, renderingHints); + ArrayList[] edgeTable = new ArrayList[(int) Math.ceil(maxY) - (int) Math.ceil(minY) + 1]; @@ -1493,7 +1513,7 @@ public abstract class AbstractGraphics2D { int x0 = (int) previous.xIntersection; int x1 = (int) edge.xIntersection; - fillScanline(x0, x1, y); + fillScanline(pCtx, x0, x1, y); previous = edge; active = false; } @@ -1508,6 +1528,7 @@ public abstract class AbstractGraphics2D } } } + pCtx.dispose(); } /** @@ -1517,16 +1538,16 @@ public abstract class AbstractGraphics2D * @param x1 the right offset * @param y the scanline */ - protected void fillScanline(int x0, int x1, int y) + protected void fillScanline(PaintContext pCtx, int x0, int x1, int y) { - if (paint instanceof Color && composite == AlphaComposite.SrcOver) - { - rawDrawLine(x0, y, x1, y); - } - else - { - throw new UnsupportedOperationException("Not yet implemented."); - } + Raster paintRaster = pCtx.getRaster(x0, y, x1 - x0, 1); + ColorModel paintColorModel = pCtx.getColorModel(); + CompositeContext cCtx = composite.createContext(paintColorModel, + getColorModel(), + renderingHints); + cCtx.compose(paintRaster, destinationRaster, destinationRaster); + updateRaster(destinationRaster, x0, y, x1 - x0, 1); + cCtx.dispose(); } /** @@ -1539,14 +1560,22 @@ public abstract class AbstractGraphics2D * @param maxY the bounding box, lower Y */ private void fillShapeAntialias(ArrayList segs, double minX, double minY, - double maxX, double maxY) + double maxX, double maxY, + Rectangle2D userBounds) { // This is an implementation of a polygon scanline conversion algorithm // described here: // http://www.cs.berkeley.edu/~ug/slide/pipeline/assignments/scan/ // The antialiasing is implemented using a sampling technique, we do // not scan whole lines but fractions of the line. - + + Rectangle deviceBounds = new Rectangle((int) minX, (int) minY, + (int) Math.ceil(maxX) - (int) minX, + (int) Math.ceil(maxY) - (int) minY); + PaintContext pCtx = paint.createContext(getColorModel(), deviceBounds, + userBounds, transform, + renderingHints); + // This array will contain the oversampled transparency values for // each pixel in the scanline. int numScanlines = (int) Math.ceil(maxY) - (int) minY; @@ -1702,10 +1731,12 @@ public abstract class AbstractGraphics2D firstSubline = 0; // Render full scanline. //System.err.println("scanline: " + y); - fillScanlineAA(alpha, (int) minX, (int) y, numScanlinePixels); + fillScanlineAA(alpha, (int) minX, (int) y, numScanlinePixels, pCtx); } if (paint instanceof Color && composite == AlphaComposite.SrcOver) rawSetForeground((Color) paint); + + pCtx.dispose(); } /** @@ -1717,69 +1748,45 @@ public abstract class AbstractGraphics2D * @param x0 the beginning of the scanline * @param y the y coordinate of the line */ - private void fillScanlineAA(int[] alpha, int x0, int y, int numScanlinePixels) - { - int lastX = x0; - int lastAlpha = 0; - for (int i = 0; i < numScanlinePixels; i++) + private void fillScanlineAA(int[] alpha, int x0, int y, int numScanlinePixels, + PaintContext pCtx) + { + // FIXME: This doesn't work. Fixit. + CompositeContext cCtx = composite.createContext(pCtx.getColorModel(), + getColorModel(), + renderingHints); + Raster paintRaster = pCtx.getRaster(x0, y, numScanlinePixels, 1); + System.err.println("paintColorModel: " + pCtx.getColorModel()); + WritableRaster aaRaster = paintRaster.createCompatibleWritableRaster(); + int numBands = paintRaster.getNumBands(); + int[] pixels = new int[numScanlinePixels + paintRaster.getNumBands()]; + pixels = paintRaster.getPixels(x0, y, numScanlinePixels, 1, pixels); + ColorModel cm = pCtx.getColorModel(); + + double lastAlpha = 0.; + int lastAlphaInt = 0; + int[] components = new int[4]; + + for (int i = 0; i < pixels.length; i++) { - if (alpha[i] == 0) - continue; - if (lastAlpha > 0) + if (alpha[i] != 0) { - //System.err.println("rawDrawScanline: " + lastX + ", " + (i+x0) + ", " + lastAlpha); - // TODO: Avoid double arithmetic. - fillScanlineAlpha(lastX, i + x0, y, lastAlpha); + lastAlphaInt += alpha[i]; + lastAlpha = lastAlphaInt / AA_SAMPLING; } - lastAlpha += alpha[i]; - alpha[i] = 0; - lastX = i + x0; + components = cm.getComponents(pixel[i], components, 0); + components[0] = (int) (components[0] * lastAlpha); + pixel[i] = cm.getDataElement(components, 0); } - if (lastAlpha > 0) - // TODO: Avoid double arithmetic. - fillScanlineAlpha(lastX, x0 + numScanlinePixels, y, lastAlpha); - } - /** - * Renders one scanline with alpha sampling for anti-aliased shape rendering. - * - * @param x0 the start offset - * @param x1 the end offset - * @param y the scanline - * @param sample the sample value, relative to AA_SAMPLING - */ - private void fillScanlineAlpha(int x0, int x1, int y, int sample) - { - if (paint instanceof Color && composite == AlphaComposite.SrcOver) - { - // FIXME: We should composite over current pixels, not over the - // background color. - Color fg = (Color) paint; - if (sample < AA_SAMPLING) - { - Color bg = background; - int bgShare = (AA_SAMPLING - sample); - int red = (fg.getRed() * sample + bg.getRed() * bgShare) - / AA_SAMPLING; - int green = (fg.getGreen() * sample + bg.getGreen() * bgShare) - / AA_SAMPLING; - int blue = (fg.getBlue() * sample + bg.getBlue() * bgShare) - / AA_SAMPLING; - rawSetForeground(red, green, blue); - fillScanline(x0, x1 - 1, y); - } - else - { - rawSetForeground(fg); - fillScanline(x0, x1 - 1, y); - } - } - else - { - throw new UnsupportedOperationException("Not yet implemented"); - } + aaRaster.setPixels(0, 0, numScanlinePixels, 1, pixels); + cCtx.compose(aaRaster, destinationRaster, destinationRaster); + updateRaster(destinationRaster, x0, y, numScanlinePixels, 1); + + cCtx.dispose(); } + /** * Initializes this graphics object. This must be called by subclasses in * order to correctly initialize the state of this object. @@ -1793,9 +1800,38 @@ public abstract class AbstractGraphics2D // FIXME: Should not be necessary. A clip of null should mean // 'clip against device bounds. clip = getDeviceBounds(); + destinationRaster = getDestinationRaster(); } - //protected abstract Raster getDestinationRaster(int x, int y, int w, int h); + /** + * Returns a WritableRaster that is used by this class to perform the + * rendering in. It is not necessary that the target surface immediately + * reflects changes in the raster. Updates to the raster are notified via + * {@link #updateRaster}. + * + * @return the destination raster + */ + protected abstract WritableRaster getDestinationRaster(); + + /** + * Notifies the backend that the raster has changed in the specified + * rectangular area. The raster that is provided in this method is always + * the same as the one returned in {@link #getDestinationRaster}. + * Backends that reflect changes to this raster directly don't need to do + * anything here. + * + * @param raster the updated raster, identical to the raster returned + * by {@link #getDestinationRaster()} + * @param x the upper left corner of the updated region, X coordinate + * @param y the upper lef corner of the updated region, Y coordinate + * @param w the width of the updated region + * @param h the height of the updated region + */ + protected void updateRaster(Raster raster, int x, int y, int w, int h) + { + // Nothing to do here. Backends that need to update their surface + // to reflect the change should override this method. + } // Some helper methods. diff --git a/gnu/java/awt/java2d/AlphaCompositeContext.java b/gnu/java/awt/java2d/AlphaCompositeContext.java index e01296f2d..e67c92148 100644 --- a/gnu/java/awt/java2d/AlphaCompositeContext.java +++ b/gnu/java/awt/java2d/AlphaCompositeContext.java @@ -42,7 +42,6 @@ import java.awt.AWTError; import java.awt.AlphaComposite; import java.awt.CompositeContext; import java.awt.image.ColorModel; -import java.awt.image.DataBuffer; import java.awt.image.Raster; import java.awt.image.WritableRaster; @@ -180,7 +179,7 @@ public class AlphaCompositeContext int width = src.getWidth(); int height = src.getHeight(); int x1 = x0 + width; - int y1 = x0 + height; + int y1 = y0 + height; Object srcPixel = null; Object dstPixel = null; @@ -213,36 +212,9 @@ public class AlphaCompositeContext for (int x = x0; x < x1; x++) { // Fetch source pixel. - switch (srcTransferType) - { - case DataBuffer.TYPE_INT: - srcPixel = src.getPixel(x, y, (int[]) srcPixel); - break; - case DataBuffer.TYPE_FLOAT: - srcPixel = src.getPixel(x, y, (float[]) srcPixel); - break; - case DataBuffer.TYPE_DOUBLE: - srcPixel = src.getPixel(x, y, (double[]) srcPixel); - break; - default: - throw new AWTError("Invalid transfer type for source raster"); - } + srcPixel = src.getDataElements(x, y, (int[]) srcPixel); // Fetch destination pixel. - switch (dstTransferType) - { - case DataBuffer.TYPE_INT: - dstPixel = dstIn.getPixel(x, y, (int[]) dstPixel); - break; - case DataBuffer.TYPE_FLOAT: - dstPixel = dstIn.getPixel(x, y, (float[]) dstPixel); - break; - case DataBuffer.TYPE_DOUBLE: - dstPixel = dstIn.getPixel(x, y, (double[]) dstPixel); - break; - default: - throw new AWTError("Invalid transfer type for source raster"); - } - + dstPixel = dstIn.getDataElements(x, y, dstPixel); // Get normalized components. This is the only type that is // guaranteed to be supported by all ColorModels. srcComponents = @@ -250,7 +222,7 @@ public class AlphaCompositeContext if (! srcColorModel.hasAlpha()) srcComponents[srcComponentsLength - 1] = 1.0F; dstComponents = - dstColorModel.getNormalizedComponents(dstPixel, srcComponents, 0); + dstColorModel.getNormalizedComponents(dstPixel, dstComponents, 0); if (! dstColorModel.hasAlpha()) dstComponents[dstComponentsLength - 1] = 1.0F; @@ -259,17 +231,17 @@ public class AlphaCompositeContext srcComponents[srcComponentsLength - 1] *= compositeAlpha; if (srcColorModel.isAlphaPremultiplied()) { - for (int i = srcComponentsLength - 2; i >= 0; i++) + for (int i = srcComponentsLength - 2; i >= 0; i--) srcComponents[i] *= compositeAlpha; } else { - for (int i = srcComponentsLength - 2; i >= 0; i++) + for (int i = srcComponentsLength - 1; i >= 0; i--) srcComponents[i] *= srcComponents[srcComponentsLength - 1]; } if (! dstColorModel.isAlphaPremultiplied()) { - for (int i = dstComponentsLength - 2; i >= 0; i++) + for (int i = dstComponentsLength - 2; i >= 0; i--) dstComponents[i] *= dstComponents[dstComponents.length - 1]; } @@ -319,7 +291,7 @@ public class AlphaCompositeContext for (int i = 0; i < srcComponentsLength; i++) { dstComponents[i] = srcComponents[i] * fs - + dstComponents[i] * fd; + + dstComponents[i] * fd; } // Convert the result back when the destination is not @@ -336,19 +308,7 @@ public class AlphaCompositeContext // Store the result in the destination raster. dstPixel = dstColorModel.getDataElements(dstComponents, 0, dstPixel); - switch (dstTransferType) - { - case DataBuffer.TYPE_INT: - dstOut.setPixel(x, y, (int[] ) dstPixel); - break; - case DataBuffer.TYPE_FLOAT: - dstOut.setPixel(x, y, (float[] ) dstPixel); - break; - case DataBuffer.TYPE_DOUBLE: - dstOut.setPixel(x, y, (double[] ) dstPixel); - break; - } - + dstOut.setDataElements(x, y, dstPixel); } // End X loop. } // End Y loop. } diff --git a/gnu/java/awt/peer/GLightweightPeer.java b/gnu/java/awt/peer/GLightweightPeer.java index 4076ba531..88733b92f 100644 --- a/gnu/java/awt/peer/GLightweightPeer.java +++ b/gnu/java/awt/peer/GLightweightPeer.java @@ -82,7 +82,7 @@ import java.awt.peer.LightweightPeer; * Lightweight components are painted directly onto their parent * containers through an Image object provided by the toolkit. */ -public class GLightweightPeer extends MouseAdapter +public class GLightweightPeer implements LightweightPeer, ContainerPeer { private Component comp; @@ -92,7 +92,6 @@ public class GLightweightPeer extends MouseAdapter public GLightweightPeer(Component comp) { this.comp = comp; - comp.addMouseListener(this); } // -------- java.awt.peer.ContainerPeer implementation: @@ -363,10 +362,4 @@ public class GLightweightPeer extends MouseAdapter { } - - /** MouseListener for cursor changes. */ - public void mouseEntered(MouseEvent event) - { - setCursor(comp.getCursor()); - } } diff --git a/gnu/java/awt/peer/gtk/GtkImage.java b/gnu/java/awt/peer/gtk/GtkImage.java index a8cbbe6c1..5e5f1de01 100644 --- a/gnu/java/awt/peer/gtk/GtkImage.java +++ b/gnu/java/awt/peer/gtk/GtkImage.java @@ -583,6 +583,9 @@ public class GtkImage extends Image srcHeight = height - srcY; } + if ( this.width <= 0 || this.height <= 0 ) + return true; + if ( srcWidth <= 0 || srcHeight <= 0 || dstWidth <= 0 || dstHeight <= 0) return true; @@ -616,6 +619,9 @@ public class GtkImage extends Image if (addObserver(observer)) return false; + if ( this.width <= 0 || this.height <= 0 ) + return true; + synchronized(GdkPixbufDecoder.pixbufLock) { if(bgcolor != null) diff --git a/gnu/java/text/StringFormatBuffer.java b/gnu/java/text/StringFormatBuffer.java index 5772186b4..19b621ce4 100644 --- a/gnu/java/text/StringFormatBuffer.java +++ b/gnu/java/text/StringFormatBuffer.java @@ -118,4 +118,10 @@ public class StringFormatBuffer implements FormatBuffer { return buffer; } + + public String toString() + { + return buffer.toString(); + } + } diff --git a/gnu/xml/dom/DomNode.java b/gnu/xml/dom/DomNode.java index c06a4c1f1..f0915eb5e 100644 --- a/gnu/xml/dom/DomNode.java +++ b/gnu/xml/dom/DomNode.java @@ -1113,12 +1113,15 @@ public abstract class DomNode { DomDocument doc = (nodeType == DOCUMENT_NODE) ? (DomDocument) node : node.owner; + boolean building = doc.building; + doc.building = true; // Permit certain structural rules for (DomNode ctx = first; ctx != null; ctx = ctx.next) { DomNode newChild = (DomNode) ctx.cloneNode(deep); newChild.setOwner(doc); node.appendChild(newChild); } + doc.building = building; } if (nodeType == ENTITY_REFERENCE_NODE) { diff --git a/java/awt/Component.java b/java/awt/Component.java index 8dbcc0696..2decae576 100644 --- a/java/awt/Component.java +++ b/java/awt/Component.java @@ -3091,6 +3091,8 @@ public abstract class Component mouseListener.mouseClicked(e); break; case MouseEvent.MOUSE_ENTERED: + if( isLightweight() ) + setCursor( getCursor() ); mouseListener.mouseEntered(e); break; case MouseEvent.MOUSE_EXITED: diff --git a/java/awt/geom/GeneralPath.java b/java/awt/geom/GeneralPath.java index 15fb8aba8..123833b11 100644 --- a/java/awt/geom/GeneralPath.java +++ b/java/awt/geom/GeneralPath.java @@ -1,5 +1,5 @@ /* GeneralPath.java -- represents a shape built from subpaths - Copyright (C) 2002, 2003, 2004 Free Software Foundation + Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation This file is part of GNU Classpath. @@ -79,8 +79,16 @@ import java.awt.Shape; */ public final class GeneralPath implements Shape, Cloneable { - public static final int WIND_EVEN_ODD = PathIterator.WIND_EVEN_ODD; - public static final int WIND_NON_ZERO = PathIterator.WIND_NON_ZERO; + // WORKAROUND for gcj 4.0.x (x < 3) + // fully qualify PathIterator constants. + + /** Same constant as {@link PathIterator#WIND_EVEN_ODD}. */ + public static final int WIND_EVEN_ODD + = java.awt.geom.PathIterator.WIND_EVEN_ODD; + + /** Same constant as {@link PathIterator.WIND_NON_ZERO}. */ + public static final int WIND_NON_ZERO + = java.awt.geom.PathIterator.WIND_NON_ZERO; /** Initial size if not specified. */ private static final int INIT_SIZE = 10; diff --git a/java/awt/image/ColorModel.java b/java/awt/image/ColorModel.java index ec97416ae..40307f2b9 100644 --- a/java/awt/image/ColorModel.java +++ b/java/awt/image/ColorModel.java @@ -527,8 +527,8 @@ public abstract class ColorModel implements Transparency float[] normComponents, int normOffset) { - // subclasses has to implement this method. - throw new UnsupportedOperationException(); + int[] components = getComponents(pixel, null, 0); + return getNormalizedComponents(components, 0, normComponents, normOffset); } /** diff --git a/java/net/URLClassLoader.java b/java/net/URLClassLoader.java index b291101b4..abe54e18e 100644 --- a/java/net/URLClassLoader.java +++ b/java/net/URLClassLoader.java @@ -39,6 +39,7 @@ exception statement from your version. */ package java.net; +import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.EOFException; import java.io.File; @@ -46,6 +47,7 @@ import java.io.FileInputStream; import java.io.FilePermission; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.security.AccessControlContext; import java.security.AccessController; import java.security.CodeSource; @@ -315,27 +317,51 @@ public class URLClassLoader extends SecureClassLoader jarfile = ((JarURLConnection) baseJarURL.openConnection()).getJarFile(); - + Manifest manifest; Attributes attributes; String classPathString; - if ((manifest = jarfile.getManifest()) != null + this.classPath = new Vector(); + + // This goes through the cached jar files listed + // in the INDEX.LIST file. All the jars found are added + // to the classPath vector so they can be loaded. + String dir = "META-INF/INDEX.LIST"; + if (jarfile.getEntry(dir) != null) + { + BufferedReader br = new BufferedReader(new InputStreamReader(new URL(baseJarURL, + dir).openStream())); + String line = br.readLine(); + while (line != null) + { + if (line.endsWith(".jar")) + { + try + { + this.classPath.add(new URL(baseURL, line)); + } + catch (java.net.MalformedURLException xx) + { + // Give up + } + } + line = br.readLine(); + } + } + else if ((manifest = jarfile.getManifest()) != null && (attributes = manifest.getMainAttributes()) != null && ((classPathString = attributes.getValue(Attributes.Name.CLASS_PATH)) != null)) - { - this.classPath = new Vector(); - + { StringTokenizer st = new StringTokenizer(classPathString, " "); while (st.hasMoreElements ()) { String e = st.nextToken (); try { - URL url = new URL(baseURL, e); - this.classPath.add(url); + this.classPath.add(new URL(baseURL, e)); } catch (java.net.MalformedURLException xx) { diff --git a/java/nio/ByteBufferImpl.java b/java/nio/ByteBufferImpl.java index cbe627b06..aa51a65bd 100644 --- a/java/nio/ByteBufferImpl.java +++ b/java/nio/ByteBufferImpl.java @@ -115,12 +115,10 @@ final class ByteBufferImpl extends ByteBuffer checkIfReadOnly(); mark = -1; int pos = position(); - if (pos > 0) - { - int count = remaining(); - shiftDown(0, pos, count); - position(count); - } + int n = limit() - pos; + if (n > 0) + shiftDown(0, pos, n); + position(n); limit(capacity()); return this; } diff --git a/java/text/DecimalFormat.java b/java/text/DecimalFormat.java index a9ec7767f..f64249b67 100644 --- a/java/text/DecimalFormat.java +++ b/java/text/DecimalFormat.java @@ -542,9 +542,9 @@ public class DecimalFormat extends NumberFormat // Compute exponent. long exponent = 0; double baseNumber; - if (useExponentialNotation) + if (useExponentialNotation && number > 0) { - exponent = (long) Math.floor (Math.log(number) / Math.log(10)); + exponent = (long) Math.floor (Math.log10(number)); exponent = exponent - (exponent % exponentRound); if (minimumIntegerDigits > 0) exponent -= minimumIntegerDigits - 1; @@ -654,7 +654,7 @@ public class DecimalFormat extends NumberFormat index = dest.length(); dest.setDefaultAttribute(NumberFormat.Field.EXPONENT); String exponentString = Long.toString ((long) exponent); - + for (count = 0; count < minExponentDigits-exponentString.length(); count++) dest.append((char) symbols.getZeroDigit()); diff --git a/java/util/Calendar.java b/java/util/Calendar.java index 52499ce1a..f0f1e37de 100644 --- a/java/util/Calendar.java +++ b/java/util/Calendar.java @@ -1038,6 +1038,8 @@ public abstract class Calendar public void setTimeZone(TimeZone zone) { this.zone = zone; + computeTime(); + computeFields(); } /** diff --git a/java/util/SimpleTimeZone.java b/java/util/SimpleTimeZone.java index 72d61ff19..d94f89ad3 100644 --- a/java/util/SimpleTimeZone.java +++ b/java/util/SimpleTimeZone.java @@ -333,6 +333,8 @@ public class SimpleTimeZone extends TimeZone setStartRule(startMonth, startDayOfWeekInMonth, startDayOfWeek, startTime); setEndRule(endMonth, endDayOfWeekInMonth, endDayOfWeek, endTime); + if (startMonth == endMonth) + throw new IllegalArgumentException("startMonth and endMonth must be different"); this.startYear = 0; } @@ -391,6 +393,8 @@ public class SimpleTimeZone extends TimeZone setStartRule(startMonth, startDayOfWeekInMonth, startDayOfWeek, startTime); setEndRule(endMonth, endDayOfWeekInMonth, endDayOfWeek, endTime); + if (startMonth == endMonth) + throw new IllegalArgumentException("startMonth and endMonth must be different"); this.startYear = 0; this.dstSavings = dstSavings; @@ -409,66 +413,67 @@ public class SimpleTimeZone extends TimeZone } /** - * Checks if the values are in range and + * Checks if the month, day, dayOfWeek arguments are in range and * returns the mode of the rule. * @param month the month parameter as in the constructor + * @param day the day parameter as in the constructor + * @param dayOfWeek the day of week parameter as in the constructor * @return the mode of this rule see startMode. * @exception IllegalArgumentException if parameters are out of range. * @see #SimpleTimeZone(int, String, int, int, int, int, int, int, int, int) * @see #startMode */ - private int checkRule(int month) + private int checkRule(int month, int day, int dayOfWeek) { - if (startDay != 0) + if (month < 0 || month > 11) + throw new IllegalArgumentException("month out of range"); + + int daysInMonth = getDaysInMonth(month, 1); + if (dayOfWeek == 0) + { + if (day <= 0 || day > daysInMonth) + throw new IllegalArgumentException("day out of range"); + return DOM_MODE; + } + else if (dayOfWeek > 0) { - if (startMonth < 0 || startMonth > 11) - throw new IllegalArgumentException("month out of range"); - - if (startDayOfWeek == 0) - startMode = DOM_MODE; - else - { - if (startDayOfWeek > 0) - startMode = DOW_IN_MONTH_MODE; - else - { - startDayOfWeek = -startDayOfWeek; - if (startDay < 0) - { - startDay = - startDay; - startMode = DOW_LE_DOM_MODE; - } - else - startMode = DOW_GE_DOM_MODE; - } - - if (startDayOfWeek > Calendar.SATURDAY) - throw new IllegalArgumentException("day of week out of range"); - } - - if (startMode != DOW_IN_MONTH_MODE - && (startDay <= 0 || startDay > getDaysInMonth(month, 1))) - throw new IllegalArgumentException("day out of range"); + if (Math.abs(day) > (daysInMonth + 6) / 7) + throw new IllegalArgumentException("dayOfWeekInMonth out of range"); + if (dayOfWeek > Calendar.SATURDAY) + throw new IllegalArgumentException("dayOfWeek out of range"); + return DOW_IN_MONTH_MODE; + } + else + { + if (day == 0 || Math.abs(day) > daysInMonth) + throw new IllegalArgumentException("day out of range"); + if (dayOfWeek < -Calendar.SATURDAY) + throw new IllegalArgumentException("dayOfWeek out of range"); + if (day < 0) + return DOW_LE_DOM_MODE; + else + return DOW_GE_DOM_MODE; } - return startMode; } /** - * Sets the daylight savings start rule. You must also set the end rule with - * <code>setEndRule</code> or the result of getOffset is undefined. For the - * parameters see the ten-argument constructor above. - * - * @param month The month where daylight savings start, zero based. You should - * use the constants in Calendar. + * Sets the daylight savings start rule. You must also set the + * end rule with <code>setEndRule</code> or the result of + * getOffset is undefined. For the parameters see the ten-argument + * constructor above. + * + * @param month The month where daylight savings start, zero + * based. You should use the constants in Calendar. * @param day A day of month or day of week in month. * @param dayOfWeek The day of week where daylight savings start. - * @param time The time in milliseconds standard time where daylight savings - * start. + * @param time The time in milliseconds standard time where daylight + * savings start. * @exception IllegalArgumentException if parameters are out of range. * @see SimpleTimeZone */ public void setStartRule(int month, int day, int dayOfWeek, int time) { + this.startMode = checkRule(month, day, dayOfWeek); this.startMonth = month; this.startDay = day; this.startDayOfWeek = Math.abs(dayOfWeek); @@ -478,7 +483,6 @@ public class SimpleTimeZone extends TimeZone // Convert from UTC to STANDARD this.startTime = time + this.rawOffset; useDaylight = true; - this.startMode = checkRule(month); } /** @@ -513,6 +517,9 @@ public class SimpleTimeZone extends TimeZone // or before mode. this.startDay = after ? Math.abs(day) : -Math.abs(day); this.startDayOfWeek = after ? Math.abs(dayOfWeek) : -Math.abs(dayOfWeek); + this.startMode = (dayOfWeek != 0) + ? (after ? DOW_GE_DOM_MODE : DOW_LE_DOM_MODE) + : checkRule(month, day, dayOfWeek); this.startDay = Math.abs(this.startDay); this.startDayOfWeek = Math.abs(this.startDayOfWeek); @@ -524,9 +531,6 @@ public class SimpleTimeZone extends TimeZone // Convert from UTC to STANDARD this.startTime = time + this.rawOffset; useDaylight = true; - this.startMode = (dayOfWeek != 0) - ? (after ? DOW_GE_DOM_MODE : DOW_LE_DOM_MODE) - : checkRule(month); } /** @@ -562,6 +566,7 @@ public class SimpleTimeZone extends TimeZone */ public void setEndRule(int month, int day, int dayOfWeek, int time) { + this.endMode = checkRule(month, day, dayOfWeek); this.endMonth = month; this.endDay = day; this.endDayOfWeek = Math.abs(dayOfWeek); @@ -574,7 +579,6 @@ public class SimpleTimeZone extends TimeZone // Convert from UTC to DST this.endTime = time + this.rawOffset + this.dstSavings; useDaylight = true; - this.endMode = checkRule(month); } /** @@ -607,6 +611,9 @@ public class SimpleTimeZone extends TimeZone // or before mode. this.endDay = after ? Math.abs(day) : -Math.abs(day); this.endDayOfWeek = after ? Math.abs(dayOfWeek) : -Math.abs(dayOfWeek); + this.endMode = (dayOfWeek != 0) + ? (after ? DOW_GE_DOM_MODE : DOW_LE_DOM_MODE) + : checkRule(month, day, dayOfWeek); this.endDay = Math.abs(this.endDay); this.endDayOfWeek = Math.abs(endDayOfWeek); @@ -621,9 +628,6 @@ public class SimpleTimeZone extends TimeZone // Convert from UTC to DST this.endTime = time + this.rawOffset + this.dstSavings; useDaylight = true; - this.endMode = (dayOfWeek != 0) - ? (after ? DOW_GE_DOM_MODE : DOW_LE_DOM_MODE) - : checkRule(month); } /** @@ -770,7 +774,7 @@ public class SimpleTimeZone extends TimeZone * @param year The year. */ private int getDaysInMonth(int month, int year) - { + { if (month == Calendar.FEBRUARY) { if ((year & 3) != 0) diff --git a/java/util/logging/Logger.java b/java/util/logging/Logger.java index 567020ef7..29f19e440 100644 --- a/java/util/logging/Logger.java +++ b/java/util/logging/Logger.java @@ -41,6 +41,8 @@ package java.util.logging; import java.util.List; import java.util.MissingResourceException; import java.util.ResourceBundle; +import java.security.AccessController; +import java.security.PrivilegedAction; /** * A Logger is used for logging information about events. Usually, there @@ -76,7 +78,20 @@ public class Logger * products are supposed to create and use their own Loggers, so * they can be controlled individually. */ - public static final Logger global = getLogger("global"); + public static final Logger global; + + static + { + // Our class might be initialized from an unprivileged context + global = (Logger) AccessController.doPrivileged + (new PrivilegedAction() + { + public Object run() + { + return getLogger("global"); + } + }); + } /** diff --git a/java/util/zip/DeflaterEngine.java b/java/util/zip/DeflaterEngine.java index 025a0a775..51587165e 100644 --- a/java/util/zip/DeflaterEngine.java +++ b/java/util/zip/DeflaterEngine.java @@ -497,7 +497,7 @@ class DeflaterEngine implements DeflaterConstants throw new InternalError(); } } - huffman.tallyDist(strstart - matchStart, matchLen); + boolean full = huffman.tallyDist(strstart - matchStart, matchLen); lookahead -= matchLen; if (matchLen <= max_lazy && lookahead >= MIN_MATCH) @@ -516,7 +516,8 @@ class DeflaterEngine implements DeflaterConstants updateHash(); } matchLen = MIN_MATCH - 1; - continue; + if (!full) + continue; } else { diff --git a/javax/swing/AbstractButton.java b/javax/swing/AbstractButton.java index d4e35cfa3..348daece1 100644 --- a/javax/swing/AbstractButton.java +++ b/javax/swing/AbstractButton.java @@ -39,10 +39,12 @@ package javax.swing; import gnu.classpath.NotImplementedException; +import java.awt.Component; import java.awt.Graphics; import java.awt.Image; import java.awt.Insets; import java.awt.ItemSelectable; +import java.awt.LayoutManager; import java.awt.Point; import java.awt.Rectangle; import java.awt.Shape; @@ -2372,6 +2374,45 @@ public abstract class AbstractButton extends JComponent } /** + * Adds the specified component to this AbstractButton. This overrides the + * default in order to install an {@link OverlayLayout} layout manager + * before adding the component. The layout manager is only installed if + * no other layout manager has been installed before. + * + * @param comp the component to be added + * @param constraints constraints for the layout manager + * @param index the index at which the component is added + * + * @since 1.5 + */ + protected void addImpl(Component comp, Object constraints, int index) + { + // We use a client property here, so that no extra memory is used in + // the common case with no layout manager. + if (getClientProperty("AbstractButton.customLayoutSet") == null) + setLayout(new OverlayLayout(this)); + super.addImpl(comp, constraints, index); + } + + /** + * Sets a layout manager on this AbstractButton. This is overridden in order + * to detect if the application sets a custom layout manager. If no custom + * layout manager is set, {@link #addImpl(Component, Object, int)} installs + * an OverlayLayout before adding a component. + * + * @param layout the layout manager to install + * + * @since 1.5 + */ + public void setLayout(LayoutManager layout) + { + // We use a client property here, so that no extra memory is used in + // the common case with no layout manager. + putClientProperty("AbstractButton.customLayoutSet", Boolean.TRUE); + super.setLayout(layout); + } + + /** * Helper method for * {@link LookAndFeel#installProperty(JComponent, String, Object)}. * diff --git a/javax/swing/ButtonGroup.java b/javax/swing/ButtonGroup.java index 9aeae379e..3d11713cf 100644 --- a/javax/swing/ButtonGroup.java +++ b/javax/swing/ButtonGroup.java @@ -91,8 +91,12 @@ public class ButtonGroup implements Serializable { b.getModel().setGroup(this); if (b.isSelected()) - sel = b.getModel(); - buttons.addElement(b); + { + if (sel == null) + sel = b.getModel(); + else + b.setSelected(false); + } buttons.addElement(b); } /** diff --git a/javax/swing/DefaultDesktopManager.java b/javax/swing/DefaultDesktopManager.java index df2ab6cdb..0304461ad 100644 --- a/javax/swing/DefaultDesktopManager.java +++ b/javax/swing/DefaultDesktopManager.java @@ -124,8 +124,6 @@ public class DefaultDesktopManager implements DesktopManager, Serializable public void closeFrame(JInternalFrame frame) { Container c = frame.getParent(); - frame.doDefaultCloseAction(); - if (c != null) { if (frame.isIcon()) diff --git a/javax/swing/ImageIcon.java b/javax/swing/ImageIcon.java index 7347985eb..cedf4be35 100644 --- a/javax/swing/ImageIcon.java +++ b/javax/swing/ImageIcon.java @@ -288,12 +288,12 @@ public class ImageIcon } /** - * Creates an ImageIcon from the given URL without any description - * set. + * Creates an ImageIcon from the given URL and sets the description + * to the URL String representation. */ public ImageIcon(URL url) { - this(url, null); + this(url, url.toString()); } /** diff --git a/javax/swing/JComponent.java b/javax/swing/JComponent.java index 68d7d9d1c..ba3712b88 100644 --- a/javax/swing/JComponent.java +++ b/javax/swing/JComponent.java @@ -1764,8 +1764,9 @@ public abstract class JComponent extends Container implements Serializable paintBorder(g2); paintChildren(g2); Rectangle clip = g2.getClipBounds(); - if (clip.x == 0 && clip.y == 0 && clip.width == getWidth() - && clip.height == getHeight()) + if (clip == null + || (clip.x == 0 && clip.y == 0 && clip.width == getWidth() + && clip.height == getHeight())) RepaintManager.currentManager(this).markCompletelyClean(this); } } diff --git a/javax/swing/JLabel.java b/javax/swing/JLabel.java index 65b1e6fcd..a993fb8f3 100644 --- a/javax/swing/JLabel.java +++ b/javax/swing/JLabel.java @@ -38,6 +38,8 @@ exception statement from your version. */ package javax.swing; +import gnu.classpath.NotImplementedException; + import java.awt.Component; import java.awt.Font; import java.awt.Image; @@ -67,15 +69,15 @@ public class JLabel extends JComponent implements Accessible, SwingConstants implements AccessibleText, AccessibleExtendedComponent { /** - * Returns the selected text. This is an empty string since JLabels + * Returns the selected text. This is null since JLabels * are not selectable. * - * @return the selected text + * @return <code>null</code> because JLabels cannot have selected text */ public String getSelectedText() { - // We return "" here since JLabel's text is not selectable. - return ""; + // We return null here since JLabel's text is not selectable. + return null; } /** @@ -85,8 +87,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants */ public int getSelectionStart() { - // TODO: Figure out what should be returned here, because JLabels don't - // allow selection. I guess -1 for now. + // JLabel don't have selected text, so we return -1 here. return -1; } @@ -97,8 +98,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants */ public int getSelectionEnd() { - // TODO: Figure out what should be returned here, because JLabels don't - // allow selection. I guess -1 for now. + // JLabel don't have selected text, so we return -1 here. return -1; } @@ -115,6 +115,8 @@ public class JLabel extends JComponent implements Accessible, SwingConstants */ public AttributeSet getCharacterAttribute(int index) { + // FIXME: Return null here for simple labels, and query the HTML + // view for HTML labels. return new SimpleAttributeSet(); } @@ -259,6 +261,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants */ public int getCharCount() { + // FIXME: Query HTML view for HTML labels. return text.length(); } @@ -271,6 +274,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants * @return the bounding box of the character at the specified index */ public Rectangle getCharacterBounds(int index) + throws NotImplementedException { // FIXME: Implement this correctly. return new Rectangle(); @@ -286,6 +290,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants * point */ public int getIndexAtPoint(Point point) + throws NotImplementedException { // FIXME: Implement this correctly. return 0; @@ -339,7 +344,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants */ public JLabel() { - this(null, null, LEADING); + this("", null, LEADING); } /** @@ -350,7 +355,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants */ public JLabel(Icon image) { - this(null, image, CENTER); + this("", image, CENTER); } /** @@ -363,7 +368,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants */ public JLabel(Icon image, int horizontalAlignment) { - this(null, image, horizontalAlignment); + this("", image, horizontalAlignment); } /** @@ -454,7 +459,7 @@ public class JLabel extends JComponent implements Accessible, SwingConstants */ protected String paramString() { - return "JLabel"; + return super.paramString(); } /** diff --git a/javax/swing/JOptionPane.java b/javax/swing/JOptionPane.java index 360e60af7..0bef12b61 100644 --- a/javax/swing/JOptionPane.java +++ b/javax/swing/JOptionPane.java @@ -75,13 +75,14 @@ public class JOptionPane extends JComponent implements Accessible } /** - * DOCUMENT ME! + * Returns the accessible role of this object, which is always + * {@link AccessibleRole#OPTION_PANE}. * - * @return DOCUMENT ME! + * @return the accessible role of this object */ public AccessibleRole getAccessibleRole() { - return null; + return AccessibleRole.OPTION_PANE; } } diff --git a/javax/swing/JTable.java b/javax/swing/JTable.java index 3463ac26f..1298f128d 100644 --- a/javax/swing/JTable.java +++ b/javax/swing/JTable.java @@ -1246,8 +1246,12 @@ public class JTable { Icon iconValue = (Icon) value; setIcon(iconValue); - setText(""); } + else + { + setIcon(null); + } + setText(""); return this; } } @@ -1893,8 +1897,13 @@ public class JTable int x0 = 0; - int idx0 = event.getFirstIndex(); - int idxn = event.getLastIndex(); + // We must limit the indices to the bounds of the JTable's model, because + // we might get values of -1 or greater then columnCount in the case + // when columns get removed. + int idx0 = Math.max(0, Math.min(getColumnCount() - 1, + event.getFirstIndex())); + int idxn = Math.max(0, Math.min(getColumnCount() - 1, + event.getLastIndex())); int i; for (i = 0; i < idx0; i++) @@ -1955,9 +1964,33 @@ public class JTable // affect the size parameters of the JTable. Otherwise we only need // to perform a repaint to update the view. if (event == null || event.getType() == TableModelEvent.INSERT) - revalidate(); + { + // Sync selection model with data model. + if (event != null) + { + int first = event.getFirstRow(); + if (first < 0) + first = 0; + int last = event.getLastRow(); + if (last < 0) + last = getRowCount() - 1; + selectionModel.insertIndexInterval(first, last - first + 1, true); + } + revalidate(); + } if (event == null || event.getType() == TableModelEvent.DELETE) { + // Sync selection model with data model. + if (event != null) + { + int first = event.getFirstRow(); + if (first < 0) + first = 0; + int last = event.getLastRow(); + if (last < 0) + last = getRowCount() - 1; + selectionModel.removeIndexInterval(first, last); + } if (dataModel.getRowCount() == 0) clearSelection(); revalidate(); @@ -3562,8 +3595,7 @@ public class JTable } /** - * Set value for the cell at the given position. If the cell is not - * editable, this method returns without action. The modified cell is + * Set value for the cell at the given position. The modified cell is * repainted. * * @param value the value to set @@ -3572,8 +3604,6 @@ public class JTable */ public void setValueAt(Object value, int row, int column) { - if (!isCellEditable(row, column)) - return; dataModel.setValueAt(value, row, convertColumnIndexToModel(column)); repaint(getCellRect(row, column, true)); @@ -3721,6 +3751,13 @@ public class JTable private void moveToCellBeingEdited(Component component) { Rectangle r = getCellRect(editingRow, editingColumn, true); + // Adjust bounding box of the editing component, so that it lies + // 'above' the grid on all edges, not only right and bottom. + // The table grid is painted only at the right and bottom edge of a cell. + r.x -= 1; + r.y -= 1; + r.width += 1; + r.height += 1; component.setBounds(r); } diff --git a/javax/swing/plaf/basic/BasicButtonListener.java b/javax/swing/plaf/basic/BasicButtonListener.java index 1fca69451..89e99a29a 100644 --- a/javax/swing/plaf/basic/BasicButtonListener.java +++ b/javax/swing/plaf/basic/BasicButtonListener.java @@ -52,6 +52,7 @@ import javax.swing.AbstractAction; import javax.swing.AbstractButton; import javax.swing.ButtonModel; import javax.swing.JComponent; +import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -204,14 +205,12 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener, { AbstractButton button = (AbstractButton) e.getSource(); ButtonModel model = button.getModel(); - if (button.isRolloverEnabled()) + if (button.isRolloverEnabled() + && ! SwingUtilities.isLeftMouseButton(e)) model.setRollover(true); - - if (model.isPressed() - && (e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0) + + if (model.isPressed()) model.setArmed(true); - else - model.setArmed(false); } } diff --git a/javax/swing/plaf/basic/BasicInternalFrameUI.java b/javax/swing/plaf/basic/BasicInternalFrameUI.java index 0a330e776..7ec3aa074 100644 --- a/javax/swing/plaf/basic/BasicInternalFrameUI.java +++ b/javax/swing/plaf/basic/BasicInternalFrameUI.java @@ -1205,6 +1205,15 @@ public class BasicInternalFrameUI extends InternalFrameUI frame.setLayout(internalFrameLayout); LookAndFeel.installBorder(frame, "InternalFrame.border"); frame.setFrameIcon(UIManager.getIcon("InternalFrame.icon")); + + // Let the content pane inherit the background color from its + // frame by setting the background to null. + Component contentPane = frame.getContentPane(); + if (contentPane != null + && contentPane.getBackground() instanceof UIResource) + { + contentPane.setBackground(null); + } } /** diff --git a/javax/swing/plaf/basic/BasicRadioButtonUI.java b/javax/swing/plaf/basic/BasicRadioButtonUI.java index 66e538037..a66fa28e6 100644 --- a/javax/swing/plaf/basic/BasicRadioButtonUI.java +++ b/javax/swing/plaf/basic/BasicRadioButtonUI.java @@ -45,6 +45,7 @@ import java.awt.Graphics; import java.awt.Rectangle; import javax.swing.AbstractButton; +import javax.swing.ButtonModel; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.SwingUtilities; @@ -142,14 +143,15 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI g.setFont(f); + ButtonModel m = b.getModel(); Icon currentIcon = null; - if (b.isSelected() && b.isEnabled()) + if (m.isSelected() && m.isEnabled()) currentIcon = b.getSelectedIcon(); - else if (!b.isSelected() && b.isEnabled()) + else if (! m.isSelected() && m.isEnabled()) currentIcon = b.getIcon(); - else if (b.isSelected() && !b.isEnabled()) + else if (m.isSelected() && ! m.isEnabled()) currentIcon = b.getDisabledSelectedIcon(); - else // (!b.isSelected() && !b.isEnabled()) + else // (!m.isSelected() && ! m.isEnabled()) currentIcon = b.getDisabledIcon(); SwingUtilities.calculateInnerArea(b, vr); @@ -166,7 +168,7 @@ public class BasicRadioButtonUI extends BasicToggleButtonUI if (text != null) paintText(g, b, tr, text); // TODO: Figure out what is the size parameter? - if (b.hasFocus() && b.isFocusPainted() && b.isEnabled()) + if (b.hasFocus() && b.isFocusPainted() && m.isEnabled()) paintFocus(g, tr, null); } diff --git a/javax/swing/plaf/basic/BasicTableHeaderUI.java b/javax/swing/plaf/basic/BasicTableHeaderUI.java index fbef6e69f..cfbebda21 100644 --- a/javax/swing/plaf/basic/BasicTableHeaderUI.java +++ b/javax/swing/plaf/basic/BasicTableHeaderUI.java @@ -99,6 +99,11 @@ public class BasicTableHeaderUI extends TableHeaderUI * The header cell border. */ private Border cellBorder; + + /** + * Original mouse cursor prior to resizing. + */ + private Cursor originalCursor; /** * If not null, one of the columns is currently being dragged. @@ -245,6 +250,7 @@ public class BasicTableHeaderUI extends TableHeaderUI if (onBoundary) { + originalCursor = header.getCursor(); if (p < x) header.setCursor(Cursor.getPredefinedCursor (Cursor.W_RESIZE_CURSOR)); @@ -254,7 +260,7 @@ public class BasicTableHeaderUI extends TableHeaderUI } else { - header.setCursor(Cursor.getDefaultCursor()); + header.setCursor(originalCursor); header.setResizingColumn(null); } @@ -345,7 +351,7 @@ public class BasicTableHeaderUI extends TableHeaderUI showingResizeCursor = false; if (timer != null) timer.stop(); - header.setCursor(Cursor.getDefaultCursor()); + header.setCursor(originalCursor); } /** diff --git a/javax/swing/plaf/basic/BasicTableUI.java b/javax/swing/plaf/basic/BasicTableUI.java index 0711ce385..ef491cbf1 100644 --- a/javax/swing/plaf/basic/BasicTableUI.java +++ b/javax/swing/plaf/basic/BasicTableUI.java @@ -1245,17 +1245,19 @@ public class BasicTableUI extends TableUI int rn = table.rowAtPoint(p2); if (rn == -1) rn = table.getRowCount() - 1; - + + int columnMargin = table.getColumnModel().getColumnMargin(); + int rowMargin = table.getRowMargin(); + TableColumnModel cmodel = table.getColumnModel(); int [] widths = new int[cn+1]; for (int i = c0; i <=cn ; i++) { - widths[i] = cmodel.getColumn(i).getWidth(); + widths[i] = cmodel.getColumn(i).getWidth() - columnMargin; } Rectangle bounds = table.getCellRect(r0, c0, false); - bounds.height = table.getRowHeight()+table.getRowMargin(); - + // The left boundary of the area being repainted. int left = bounds.x; @@ -1265,9 +1267,6 @@ public class BasicTableUI extends TableUI // The bottom boundary of the area being repainted. int bottom; - // The cell height. - int height = bounds.height; - // paint the cell contents Color grid = table.getGridColor(); for (int r = r0; r <= rn; ++r) @@ -1276,25 +1275,28 @@ public class BasicTableUI extends TableUI { bounds.width = widths[c]; paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c)); - bounds.x += widths[c]; + bounds.x += widths[c] + columnMargin; } - bounds.y += height; bounds.x = left; + bounds.y += table.getRowHeight(r) + rowMargin; + // Update row height for tables with custom heights. + bounds.height = table.getRowHeight(r + 1); } - bottom = bounds.y; + bottom = bounds.y - rowMargin; // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { Color save = gfx.getColor(); gfx.setColor(grid); - int x = left; - + int x = left - columnMargin; for (int c = c0; c <= cn; ++c) { + // The vertical grid is draw right from the cells, so we + // add before drawing. + x += widths[c] + columnMargin; gfx.drawLine(x, top, x, bottom); - x += widths[c]; } gfx.setColor(save); } @@ -1304,11 +1306,13 @@ public class BasicTableUI extends TableUI { Color save = gfx.getColor(); gfx.setColor(grid); - int y = top; + int y = top - rowMargin; for (int r = r0; r <= rn; ++r) { + // The horizontal grid is draw below the cells, so we + // add before drawing. + y += table.getRowHeight(r) + rowMargin; gfx.drawLine(left, y, p2.x, y); - y += height; } gfx.setColor(save); } diff --git a/javax/swing/plaf/basic/BasicTreeUI.java b/javax/swing/plaf/basic/BasicTreeUI.java index fb09ac998..48ad1b93d 100644 --- a/javax/swing/plaf/basic/BasicTreeUI.java +++ b/javax/swing/plaf/basic/BasicTreeUI.java @@ -1376,6 +1376,12 @@ public class BasicTreeUI public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; + + int rows = treeState.getRowCount(); + + if (rows == 0) + // There is nothing to do if the tree is empty. + return; Rectangle clip = g.getClipBounds(); @@ -1387,9 +1393,7 @@ public class BasicTreeUI int endIndex = tree.getClosestRowForLocation(clip.x + clip.width, clip.y + clip.height); - // Also paint dashes to the invisible nodes below: - int rows = treeState.getRowCount(); - + // Also paint dashes to the invisible nodes below. // These should be painted first, otherwise they may cover // the control icons. if (endIndex < rows) diff --git a/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java b/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java index 534f0ca34..f74828e56 100644 --- a/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java +++ b/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java @@ -93,7 +93,11 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane public void propertyChange(PropertyChangeEvent e) { String propName = e.getPropertyName(); - if (propName.equals("JInternalFrame.isPalette")) + if (e.getPropertyName().equals(JInternalFrame.FRAME_ICON_PROPERTY)) + { + title.setIcon( frame.getFrameIcon() ); + } + else if (propName.equals("JInternalFrame.isPalette")) { if (e.getNewValue().equals(Boolean.TRUE)) setPalette(true); @@ -262,7 +266,7 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane paletteTitleHeight = UIManager.getInt("InternalFrame.paletteTitleHeight"); paletteCloseIcon = UIManager.getIcon("InternalFrame.paletteCloseIcon"); minIcon = MetalIconFactory.getInternalFrameAltMaximizeIcon(16); - + title = new JLabel(frame.getTitle(), MetalIconFactory.getInternalFrameDefaultMenuIcon(), SwingConstants.LEFT); @@ -383,8 +387,8 @@ public class MetalInternalFrameTitlePane extends BasicInternalFrameTitlePane paintPalette(g); else { - paintTitleBackground(g); - paintChildren(g); + paintTitleBackground(g); + paintChildren(g); Dimension d = getSize(); if (frame.isSelected()) g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); diff --git a/javax/swing/plaf/metal/MetalLookAndFeel.java b/javax/swing/plaf/metal/MetalLookAndFeel.java index 0011b1c17..d7cd9ab24 100644 --- a/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -1204,7 +1204,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", - new BorderUIResource.LineBorderUIResource(getControlShadow()), + new BorderUIResource.LineBorderUIResource(getFocusColor()), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), diff --git a/javax/swing/plaf/metal/OceanTheme.java b/javax/swing/plaf/metal/OceanTheme.java index cfba4b5ff..9d76ff7e8 100644 --- a/javax/swing/plaf/metal/OceanTheme.java +++ b/javax/swing/plaf/metal/OceanTheme.java @@ -43,6 +43,7 @@ import java.util.Arrays; import javax.swing.UIDefaults; import javax.swing.plaf.ColorUIResource; +import javax.swing.plaf.BorderUIResource.LineBorderUIResource; /** * A modern theme for the Metal Look & Feel. @@ -264,6 +265,10 @@ public class OceanTheme extends DefaultMetalTheme defaults.put("ToolBar.borderColor", c3); defaults.put("Tree.selectionBorderColor", PRIMARY1); + // Borders. + defaults.put("Table.focusCellHighlightBorder", + new LineBorderUIResource(getPrimary1())); + // Insets. defaults.put("TabbedPane.contentBorderInsets", new Insets(4, 2, 3, 3)); defaults.put("TabbedPane.tabAreaInsets", new Insets(2, 2, 0, 6)); diff --git a/javax/swing/table/DefaultTableCellRenderer.java b/javax/swing/table/DefaultTableCellRenderer.java index f56fd4f0e..a9bbe9a78 100644 --- a/javax/swing/table/DefaultTableCellRenderer.java +++ b/javax/swing/table/DefaultTableCellRenderer.java @@ -58,7 +58,7 @@ public class DefaultTableCellRenderer extends JLabel { static final long serialVersionUID = 7878911414715528324L; - protected static Border noFocusBorder = new EmptyBorder(0, 0, 0, 0); + protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1); public static class UIResource extends DefaultTableCellRenderer implements javax.swing.plaf.UIResource @@ -163,17 +163,17 @@ public class DefaultTableCellRenderer extends JLabel super.setForeground(table.getForeground()); } + Border b = null; if (hasFocus) { - setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); - if (table.isCellEditable(row, column)) - { - super.setBackground(UIManager.getColor("Table.focusCellBackground")); - super.setForeground(UIManager.getColor("Table.focusCellForeground")); - } + if (isSelected) + b = UIManager.getBorder("Table.focusSelectedCellHighlightBorder"); + if (b == null) + b = UIManager.getBorder("Table.focusCellHighlightBorder"); } else - setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); + b = noFocusBorder; + setBorder(b); setFont(table.getFont()); diff --git a/javax/swing/table/DefaultTableModel.java b/javax/swing/table/DefaultTableModel.java index c281caa07..09be2f752 100644 --- a/javax/swing/table/DefaultTableModel.java +++ b/javax/swing/table/DefaultTableModel.java @@ -294,12 +294,7 @@ public class DefaultTableModel extends AbstractTableModel else { int rowsToAdd = rowCount - existingRowCount; - for (int i = 0; i < rowsToAdd; i++) - { - Vector tmp = new Vector(); - tmp.setSize(columnIdentifiers.size()); - dataVector.add(tmp); - } + addExtraRows(rowsToAdd, columnIdentifiers.size()); fireTableRowsInserted(existingRowCount,rowCount-1); } } @@ -366,12 +361,7 @@ public class DefaultTableModel extends AbstractTableModel if (columnData.length > dataVector.size()) { int rowsToAdd = columnData.length - dataVector.size(); - for (int i = 0; i < rowsToAdd; i++) - { - Vector tmp = new Vector(); - tmp.setSize(columnIdentifiers.size()); - dataVector.add(tmp); - } + addExtraRows(rowsToAdd, columnIdentifiers.size()); } else if (columnData.length < dataVector.size()) { @@ -502,7 +492,8 @@ public class DefaultTableModel extends AbstractTableModel else { if (column < getColumnCount()) - { + { + checkSize(); Object id = columnIdentifiers.get(column); if (id != null) result = id.toString(); @@ -588,4 +579,41 @@ public class DefaultTableModel extends AbstractTableModel vector.add(convertToVector(data[i])); return vector; } + + /** + * This method adds some rows to <code>dataVector</code>. + * + * @param rowsToAdd number of rows to add + * @param nbColumns size of the added rows + */ + private void addExtraRows(int rowsToAdd, int nbColumns) + { + for (int i = 0; i < rowsToAdd; i++) + { + Vector tmp = new Vector(); + tmp.setSize(columnIdentifiers.size()); + dataVector.add(tmp); + } + } + + /** + * Checks the real columns/rows sizes against the ones returned by + * <code>getColumnCount()</code> and <code>getRowCount()</code>. + * If the supposed one are bigger, then we grow <code>columIdentifiers</code> + * and <code>dataVector</code> to their expected size. + */ + private void checkSize() + { + int columnCount = getColumnCount(); + int rowCount = getRowCount(); + + if (columnCount > columnIdentifiers.size()) + columnIdentifiers.setSize(columnCount); + + if (rowCount > dataVector.size()) + { + int rowsToAdd = rowCount - dataVector.size(); + addExtraRows(rowsToAdd, columnCount); + } + } } diff --git a/javax/swing/text/AbstractDocument.java b/javax/swing/text/AbstractDocument.java index bb065044d..801a0cdb4 100644 --- a/javax/swing/text/AbstractDocument.java +++ b/javax/swing/text/AbstractDocument.java @@ -543,6 +543,10 @@ public abstract class AbstractDocument implements Document, Serializable * * <p>If a {@link DocumentFilter} is installed in this document, the * corresponding method of the filter object is called.</p> + * + * <p>The method has no effect when <code>text</code> is <code>null</code> + * or has a length of zero.</p> + * * * @param offset the location at which the string should be inserted * @param text the content to be inserted @@ -554,10 +558,14 @@ public abstract class AbstractDocument implements Document, Serializable public void insertString(int offset, String text, AttributeSet attributes) throws BadLocationException { - if (documentFilter != null) - documentFilter.insertString(getBypass(), offset, text, attributes); - else + // Bail out if we have a bogus insertion (Behavior observed in RI). + if (text == null || text.length() == 0) + return; + + if (documentFilter == null) insertStringImpl(offset, text, attributes); + else + documentFilter.insertString(getBypass(), offset, text, attributes); } void insertStringImpl(int offset, String text, AttributeSet attributes) @@ -706,8 +714,14 @@ public abstract class AbstractDocument implements Document, Serializable * Removes a piece of content from this <code>Document</code>. * * <p>If a {@link DocumentFilter} is installed in this document, the - * corresponding method of the filter object is called.</p> - * + * corresponding method of the filter object is called. The + * <code>DocumentFilter</code> is called even if <code>length</code> + * is zero. This is different from {@link #replace}.</p> + * + * <p>Note: When <code>length</code> is zero or below the call is not + * forwarded to the underlying {@link AbstractDocument.Content} instance + * of this document and no exception is thrown.</p> + * * @param offset the start offset of the fragment to be removed * @param length the length of the fragment to be removed * @@ -717,14 +731,18 @@ public abstract class AbstractDocument implements Document, Serializable */ public void remove(int offset, int length) throws BadLocationException { - if (documentFilter != null) - documentFilter.remove(getBypass(), offset, length); - else + if (documentFilter == null) removeImpl(offset, length); + else + documentFilter.remove(getBypass(), offset, length); } void removeImpl(int offset, int length) throws BadLocationException { + // Prevent some unneccessary method invocation (observed in the RI). + if (length <= 0) + return; + DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); @@ -752,6 +770,10 @@ public abstract class AbstractDocument implements Document, Serializable * * <p>If a {@link DocumentFilter} is installed in this document, the * corresponding method of the filter object is called.</p> + * + * <p>The method has no effect if <code>length</code> is zero (and + * only zero) and, at the same time, <code>text</code> is + * <code>null</code> or has zero length.</p> * * @param offset the start offset of the fragment to be removed * @param length the length of the fragment to be removed @@ -768,10 +790,25 @@ public abstract class AbstractDocument implements Document, Serializable AttributeSet attributes) throws BadLocationException { - if (documentFilter != null) - documentFilter.replace(getBypass(), offset, length, text, attributes); + // Bail out if we have a bogus replacement (Behavior observed in RI). + if (length == 0 + && (text == null || text.length() == 0)) + return; + + if (documentFilter == null) + { + // It is important to call the methods which again do the checks + // of the arguments and the DocumentFilter because subclasses may + // have overridden these methods and provide crucial behavior + // which would be skipped if we call the non-checking variants. + // An example for this is PlainDocument where insertString can + // provide a filtering of newlines. + remove(offset, length); + insertString(offset, text, attributes); + } else - replaceImpl(offset, length, text, attributes); + documentFilter.replace(getBypass(), offset, length, text, attributes); + } void replaceImpl(int offset, int length, String text, diff --git a/javax/swing/tree/DefaultTreeSelectionModel.java b/javax/swing/tree/DefaultTreeSelectionModel.java index e38850af8..1a761d6c7 100644 --- a/javax/swing/tree/DefaultTreeSelectionModel.java +++ b/javax/swing/tree/DefaultTreeSelectionModel.java @@ -121,7 +121,7 @@ public class DefaultTreeSelectionModel /** * The row of the last added path according to the RowMapper. */ - protected int leadRow; + protected int leadRow = -1; /** * Constructs a new DefaultTreeSelectionModel. diff --git a/native/jni/java-net/javanet.c b/native/jni/java-net/javanet.c index 0a1b84a8e..e500c6084 100644 --- a/native/jni/java-net/javanet.c +++ b/native/jni/java-net/javanet.c @@ -835,6 +835,9 @@ _javanet_accept (JNIEnv * env, jobject this, jobject impl) } while (result != TARGET_NATIVE_OK); + /* Reset the inherited timeout. */ + TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_TIMEOUT (newfd, 0, result); + /* Populate instance variables */ _javanet_set_int_field (env, impl, "gnu/java/net/PlainSocketImpl", "native_fd", newfd); diff --git a/tools/gnu/classpath/tools/keytool/ExportCmd.java b/tools/gnu/classpath/tools/keytool/ExportCmd.java index 0d1692245..c1c0d4f83 100644 --- a/tools/gnu/classpath/tools/keytool/ExportCmd.java +++ b/tools/gnu/classpath/tools/keytool/ExportCmd.java @@ -216,7 +216,7 @@ class ExportCmd extends Command { setOutputStreamParam(_certFileName); setKeyStoreParams(_providerClassName, _ksType, _ksPassword, _ksURL); - setAliasParam(alias); + setAliasParam(_alias); log.finer("-export handler will use the following options:"); log.finer(" -alias=" + alias); |