Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.2386.2.81 diff -u -3 -p -u -r1.2386.2.81 ChangeLog --- ChangeLog 7 Feb 2005 02:45:43 -0000 1.2386.2.81 +++ ChangeLog 15 Feb 2005 20:55:10 -0000 @@ -1,3 +1,410 @@ +2005-02-14 Sven de Marothy
+ + * java/util/Calendar.java + (Calendar): Constructor should clear fields. + +2005-02-14 Sven de Marothy + + * javax/swing/SpinnerDateModel.java: Implemented. + +2005-02-14 Sven de Marothy + + * java/util/Calendar.java + (clear): Dates should clear to local time. + + * java/util/GregorianCalendar.java + (computeTime): Fix priority problem with DAY_OF_WEEK, + Handle non-sunday-startig weeks and minimumDaysInFirstWeek. + +2005-02-13 Mark Wielaard + + * java/awt/AWTKeyStroke.java (getAWTKeyStroke(String)): Throw + IllegalArgumentException when the given String is null. + + * javax/swing/KeyStroke.java (getKeyStroke(String)): Return null + when given keystoke sequence cannot be parsed. + + * javax/swing/JRootPane.java (setJMenuBar): Remove current menubar + if one is installed. Only install the given menubar is not null. + + * javax/swing/JViewport.java (getViewSize): Return an empty + Dimension when the view isn't set or preferred component size when + no viewSize is set. + + * javax/swing/ViewportLayout.java (preferredLayoutSize): Return an + empty Dimension when there is no view set. + (minimumLayoutSize): Likewise. + (layoutContainer): Don't try to layout when there is no view. + +2005-02-13 Mark Wielaard + + # Fixes bug #11957 + * java/io/ObjectInputStream.java (resolveClass): Don't check "void" + twice. + +2005-02-13 Tom Tromey + + * gnu/xml/aelfred2/SAXDriver.java: Ensure that null is returned when + attribute index is out of bounds. + +2005-02-12 Mark Wielaard + + Fixes bug #11949 + * java/awt/BasicStroke.java (hashCode): Check for null dash. + +2005-02-11 Andrew John Hughes + + * gnu/java/awt/color/ClutProfileConverter.java, + gnu/java/awt/peer/ClasspathTextLayoutPeer.java, + gnu/java/awt/peer/gtk/GdkFontPeer.java, + gnu/java/awt/peer/gtk/GdkGlyphVector.java, + gnu/java/awt/peer/gtk/GdkGraphics2D.java, + gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java, + gnu/java/awt/peer/gtk/GdkPixbufDecoder.java, + gnu/java/awt/peer/gtk/GdkRobotPeer.java, + gnu/java/awt/peer/gtk/GdkTextLayout.java, + gnu/java/awt/peer/gtk/GtkButtonPeer.java, + gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java, + gnu/java/awt/peer/gtk/GtkCheckboxPeer.java, + gnu/java/awt/peer/gtk/GtkChoicePeer.java, + gnu/java/awt/peer/gtk/GtkComponentPeer.java, + gnu/java/awt/peer/gtk/GtkContainerPeer.java, + gnu/java/awt/peer/gtk/GtkDialogPeer.java, + gnu/java/awt/peer/gtk/GtkFileDialogPeer.java, + gnu/java/awt/peer/gtk/GtkFontPeer.java, + gnu/java/awt/peer/gtk/GtkFramePeer.java, + gnu/java/awt/peer/gtk/GtkLabelPeer.java, + gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java, + gnu/java/awt/peer/gtk/GtkMenuItemPeer.java, + gnu/java/awt/peer/gtk/GtkScrollPanePeer.java, + gnu/java/awt/peer/gtk/GtkTextComponentPeer.java, + gnu/java/awt/peer/gtk/GtkToolkit.java, + gnu/java/awt/peer/gtk/GtkWindowPeer.java, + gnu/java/io/EncodingManager.java, + gnu/java/io/decode/DecoderUTF8.java, + gnu/java/net/protocol/file/Connection.java, + gnu/java/net/protocol/ftp/ActiveModeDTP.java, + gnu/java/net/protocol/ftp/BlockInputStream.java, + gnu/java/net/protocol/ftp/BlockOutputStream.java, + gnu/java/net/protocol/ftp/CompressedOutputStream.java, + gnu/java/net/protocol/ftp/StreamInputStream.java, + gnu/java/net/protocol/ftp/StreamOutputStream.java, + gnu/java/net/protocol/http/Cookie.java, + gnu/java/net/protocol/http/HTTPConnection.java, + gnu/java/net/protocol/http/HTTPDateFormat.java, + gnu/java/net/protocol/http/Request.java, + gnu/java/nio/SelectorImpl.java, + gnu/java/rmi/dgc/DGCImpl.java, + gnu/java/rmi/server/UnicastConnectionManager.java, + gnu/java/security/pkcs/SignerInfo.java, + gnu/java/security/provider/EncodedKeyFactory.java, + gnu/java/security/provider/GnuDHPublicKey.java, + gnu/java/security/provider/PKIXCertPathValidatorImpl.java, + gnu/java/security/x509/X500DistinguishedName.java, + gnu/java/security/x509/X509CRL.java, + gnu/java/security/x509/X509CRLEntry.java, + gnu/java/security/x509/X509Certificate.java, + gnu/java/security/x509/ext/AuthorityKeyIdentifier.java, + gnu/java/security/x509/ext/CertificatePolicies.java, + gnu/java/security/x509/ext/PolicyConstraint.java, + gnu/xml/aelfred2/SAXDriver.java, + gnu/xml/dom/Consumer.java, + gnu/xml/dom/DomCharacterData.java, + gnu/xml/dom/DomDocument.java, + gnu/xml/dom/DomDocumentBuilder.java, + gnu/xml/dom/DomIterator.java, + gnu/xml/dom/DomNode.java, + gnu/xml/dom/DomXPathExpression.java, + gnu/xml/dom/DomXPathResult.java, + gnu/xml/dom/JAXPFactory.java, + gnu/xml/dom/ls/DomLSException.java, + gnu/xml/libxmlj/dom/GnomeDocumentBuilder.java, + gnu/xml/libxmlj/dom/GnomeXPathNodeList.java, + gnu/xml/libxmlj/sax/GnomeXMLReader.java, + gnu/xml/libxmlj/transform/GnomeTransformer.java, + gnu/xml/libxmlj/transform/GnomeTransformerFactory.java, + gnu/xml/libxmlj/util/XMLJ.java, + gnu/xml/pipeline/CallFilter.java, + gnu/xml/pipeline/DomConsumer.java, + gnu/xml/pipeline/LinkFilter.java, + gnu/xml/pipeline/NSFilter.java, + gnu/xml/pipeline/TeeConsumer.java, + gnu/xml/pipeline/ValidationConsumer.java, + gnu/xml/pipeline/WellFormednessFilter.java, + gnu/xml/pipeline/XIncludeFilter.java, + gnu/xml/pipeline/XsltFilter.java, + gnu/xml/transform/ApplyImportsNode.java, + gnu/xml/transform/Bindings.java, + gnu/xml/transform/DocumentFunction.java, + gnu/xml/transform/FormatNumberFunction.java, + gnu/xml/transform/NodeNumberNode.java, + gnu/xml/transform/NumberNode.java, + gnu/xml/transform/Stylesheet.java, + gnu/xml/transform/SystemPropertyFunction.java, + gnu/xml/transform/Template.java, + gnu/xml/transform/TemplatesImpl.java, + gnu/xml/transform/TransformerImpl.java, + gnu/xml/transform/ValueOfNode.java, + gnu/xml/transform/XSLURIResolver.java, + gnu/xml/util/DoParse.java, + gnu/xml/util/Resolver.java, + gnu/xml/xpath/Expr.java, + gnu/xml/xpath/FunctionCall.java, + gnu/xml/xpath/RelationalExpr.java, + gnu/xml/xpath/Selector.java, + gnu/xml/xpath/XPathParser.java, + java/beans/XMLDecoder.java, + java/text/SimpleDateFormat.java, + javax/swing/JPopupMenu.java, + javax/swing/JSpinner.java, + javax/swing/SortingFocusTraversalPolicy.java, + javax/swing/SwingUtilities.java, + javax/swing/plaf/basic/BasicComboBoxEditor.java, + javax/swing/plaf/basic/BasicComboBoxRenderer.java, + javax/swing/tree/DefaultMutableTreeNode.java, + javax/xml/parsers/DocumentBuilder.java, + javax/xml/parsers/DocumentBuilderFactory.java, + javax/xml/transform/sax/SAXTransformerFactory.java, + vm/reference/java/lang/VMClassLoader.java, + vm/reference/java/lang/VMProcess.java, + vm/reference/java/lang/VMRuntime.java, + vm/reference/java/lang/VMSystem.java, + vm/reference/java/security/VMAccessController.java: + Removed unused imports and expanded starred + imports. + +2005-02-12 Michael Koch + + * include/gnu_java_awt_peer_gtk_GdkFontPeer.h, + include/gnu_java_awt_peer_gtk_GdkGraphics2D.h: + Regenerated. + +2005-02-12 Graydon Hoare + + * gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java: Add. + +2005-02-12 Graydon Hoare + + * gnu/java/awt/peer/gtk/GdkFontPeer.java + (getGlyphVector): + (getFontMetrics): + (getTextMetrics): New native methods. + * gnu/java/awt/peer/gtk/GdkFontMetrics.java: Remove native parts. + * gnu/java/awt/peer/gtk/GdkGlyphVector.java: Likewise. + * gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java: + Hold reference to GtkToolkit. + * gnu/java/awt/peer/gtk/GdkGraphics2D.java + (cairoSetFont): + (cairoDrawGdkTextLayout): + (cairoDrawString): + (getPeerTextMetrics): + (getPeerFontMetrics): Remove. + (setFont): Don't call cairoSetFont. + (cairoDrawGlyphVector): Accept font peer argument. + (drawGlyphVector): Pass font peer to cairoDrawGlyphVector. + * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java: + (finalize): Call finish from here. + (produce): Not from here. + * gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java: + Hold reference to GdkGraphicsEnvironment. + * gnu/java/awt/peer/gtk/GtkToolkit.java: + (getFontMetrics): Change locking. + (getBounds): New method. + (getLocalGraphicsEnvironment): Pass reference to this. + + * include/Makefile.am: Remove entries for GdkFontMetrics, GdkGlyphVector. + * include/gnu_java_awt_peer_gtk_GdkFontMetrics.h: Remove. + * include/gnu_java_awt_peer_gtk_GdkFontPeer.h: Regenerate. + * include/gnu_java_awt_peer_gtk_GdkGlyphVector.h: Remove. + * include/gnu_java_awt_peer_gtk_GdkGraphics2D.h: Regenerate. + + * native/jni/gtk-peer/Makefile.am + Remove entries for GdkFontMetrics, GdkGlyphVector. + * native/jni/gtk-peer/gdkfont.h: Add #defines, remove struct glyphvec. + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c + (ensure_metrics_cairo): + (Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetFont): + (Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawString): + (Java_gnu_java_awt_peer_gtk_GdkGraphics2D_getPeerFontMetrics): + (Java_gnu_java_awt_peer_gtk_GdkGraphics2D_getPeerTextMetrics): + (metrics_cairo): + (metrics_surface): Remove. + (Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoDrawGlyphVector): + Pass and install font peer. + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c: + Release GDK lock while performing upcalls. + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c: Remove. + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c + (Java_gnu_java_awt_peer_gtk_GdkFontPeer_getGlyphVector): + (Java_gnu_java_awt_peer_gtk_GdkFontPeer_getFontMetrics): + (Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics): New methods. + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c: Remove. + +2005-02-11 Craig Black + + * gnu/java/awt/peer/gtk/GtkCheckboxMenuItem.java + (postMenuActionEvent): Implement to notify ItemListeners. + * java/awt/CheckboxMenuItem.java + (dispatchEventImpl): Update state on ItemEvent. + * java/awt/MenuItem.java + (processActionEvent): Retarget event source. + +2005-02-11 Thomas Fitzsimmons + + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (create): + Use GTK's built-in file system backend. Use GTK_RESPONSE_ACCEPT. + (handle_response): Use GTK_RESPONSE_ACCEPT. + +2005-02-10 Michael Koch + + * configure.ac: Define GTK_CAIRO in config.h + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c + (gtkInit): Compile Graphics2D stuff conditionally. + +2005-02-10 Chris Burdess + + * gnu/xml/dom/DomAttr.java, + gnu/xml/dom/DomCDATA.java, + gnu/xml/dom/DomCDATASection.java, + gnu/xml/dom/DomCharacterData.java, + gnu/xml/dom/DomDOMException.java, + gnu/xml/dom/DomDoctype.java, + gnu/xml/dom/DomDocument.java, + gnu/xml/dom/DomDocumentConfiguration.java, + gnu/xml/dom/DomDocumentFragment.java, + gnu/xml/dom/DomElement.java, + gnu/xml/dom/DomEx.java, + gnu/xml/dom/DomFragment.java, + gnu/xml/dom/DomImpl.java, + gnu/xml/dom/DomIterator.java, + gnu/xml/dom/DomNamedNodeMap.java, + gnu/xml/dom/DomNode.java, + gnu/xml/dom/DomNsNode.java, + gnu/xml/dom/DomPI.java, + gnu/xml/dom/DomProcessingInstruction.java, + gnu/xml/dom/DomText.java, + gnu/xml/dom/DomLSEx.java, + gnu/xml/dom/DomLSException.java, + gnu/xml/dom/DomLSParser.java, + gnu/xml/dom/DomLSSerializer.java: Refactoring of exception and DOM + implementation class names to conform to Classpath guidelines. Make + DomLSException use JDK 1.4+ exception chaining. + * gnu/xml/util/SAXNullTransformerFactory.java, + gnu/xml/xpath/Predicate.java: Use constants relative to declaring + class or interface. + +2005-02-10 Michael Koch + + * javax/swing/JTabbedPane.java + (Page.setDisplayedMnemonicIndex): Handle empty menmonic. + +2005-02-10 Graydon Hoare + + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c, + jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c: + Release GDK lock during upcalls. + +2005-02-10 Michael Koch + + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c: + Merged file header from java-gui-20050128-branch. + +2005-02-10 Michael Koch + + * java/awt/Container.java (paramString): + If layoutMgr is null just return result of super.paramString(). + +2005-02-10 Jeroen Frijters + + * java/text/Collator.java (getInstance(Locale)): + Added default collation pattern to handle case when resource + is missing and throw InternalError instead of returning null + should parsing fail. + +2005-02-09 Mark Wielaard + + * gnu/java/net/protocol/jar/Connection.java (getJarFile): + Rename jar_file to jf. + +2005-02-09 Tom Tromey + + * gnu/java/net/protocol/jar/Connection.java (getJarFile): Open + jar file with OPEN_DELETE. + * java/util/zip/ZipFile.java (ZipFile): Call deleteOnExit when + OPEN_DELETE is used. + +2005-02-09 Michael Koch + + * java/awt/Scrollbar.java: Reformatted. + +2005-02-08 Tom Tromey + + * java/net/URI.java (AUTHORITY_REGEXP): Handle case where user + name or port is missing. + (AUTHORITY_USERINFO_GROUP, AUTHORITY_HOST_GROUP, + AUTHORITY_PORT_GROUP): Updated. + +2005-02-08 Craig Black + + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c + (copyState): Pass a JNI global reference to signal handler. + (realize_cb): Use and free JNI global reference. + + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c + (create): Pass a JNI global reference to signal handler. + (selection_changed): Match declaration. + + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkGenericPeer.c + (dispose): Do not remove entries from state tables until after widget is + destroyed. + +2005-02-08 Michael Koch + + * native/jni/java-nio/java_nio_VMDirectByteBuffer.c + (NIOGetPointer): Handle case of pointer size != 32 bit. + (NIOGetRawData): Likewise. + (Java_java_nio_VMDirectByteBuffer_init): Likewise. + Fixed asking for primitive type 'long'. + +2005-02-08 Michael Koch + + * configure.ac: Define substition variable GTK_CAIRO_ENABLED. + Fix handling of GTK_CAIRO conditional. + * gnu/classpath/Configuration.java.in (GTK_CAIRO_ENABLED): + New constant. + * gnu/java/awt/peer/gtk/GdkGraphics2D.java (static): + Throw error when Cairo support was not enabled during configure time. + +2005-02-08 Michael Koch + + * javax/swing/tree/DefaultMutableTreeNode.java: + Reworked Javadocs all over. + (getPathToRoot): Fixed direction of result array initialization. + +2005-02-07 Mark Wielaard + + * java/util/ResourceBundle.java (getObject): Clarify + MissingResourceException detailed message. + (tryBundle(String,ClassLoader)): Likewise. + +2005-02-07 Craig Black + + * native/jni/classpath/native_state.c + (add_node): Update head pointer when moving node to front of list. + +2005-02-07 Andrew John Hughes + + * acinclude.m4: + (CLASSPATH_FIND_JAVAC): Add ECJ option. + (CLASSPATH_WITH_ECJ): New function. + (CLASSPATH_CHECK_ECJ): New function. + * examples/Makefile.am: + Allow examples to be built with ecj. + * lib/Makefile.am: + Allow Classpath to be built with ecj. + 2005-02-06 Mark Wielaard Reported by Timo Lindfors @@ -79,17 +486,17 @@ 2005-02-03 Dalibor Topic - * libraries/javalib/gnu/regexp/RE.java, - libraries/javalib/java/io/ObjectInputStream.java, - libraries/javalib/java/io/ObjectStreamClass.java, - libraries/javalib/java/lang/SecurityManager.java, - libraries/javalib/java/security/AllPermission.java, + * libraries/javalib/gnu/regexp/RE.java, + libraries/javalib/java/io/ObjectInputStream.java, + libraries/javalib/java/io/ObjectStreamClass.java, + libraries/javalib/java/lang/SecurityManager.java, + libraries/javalib/java/security/AllPermission.java, libraries/javalib/java/security/BasicPermission.java, - libraries/javalib/java/security/Permissions.java, - libraries/javalib/java/text/MessageFormat.java, - libraries/javalib/java/util/AbstractList.java: - Made 'inner' classes real public static inner classes, - and made them final where possible, or removed them + libraries/javalib/java/security/Permissions.java, + libraries/javalib/java/text/MessageFormat.java, + libraries/javalib/java/util/AbstractList.java: + Made 'inner' classes real public static inner classes, + and made them final where possible, or removed them where unused. 2005-02-03 Michael Koch @@ -107,7 +514,7 @@ * java/util/Calendar.java (set) Invalidate all fields on first call to set(). - + 2005-02-02 Mark Wielaard * vm/reference/java/lang/VMClassLoader.java: Remove SystemClassLoader @@ -138,34 +545,34 @@ 2005-02-02 Robert Schuster - * gnu/java/beans/decoder/GrowableArrayContext.java: Fixed - assignment behavior by using java.lang.reflect.Array.set() - directly. + * gnu/java/beans/decoder/GrowableArrayContext.java: Fixed + assignment behavior by using java.lang.reflect.Array.set() + directly. 2005-02-01 Dalibor Topic * gnu/java/beans/EmptyBeanInfo.java, gnu/java/beans/info/ComponentBeanInfo.java, - gnu/java/lang/SystemClassLoader.java: + gnu/java/lang/SystemClassLoader.java: Removed unused files. 2005-02-01 Sven de Marothy * java/util/GregorianCalendar.java - (computeTime): Fixed handling of time zones. + (computeTime): Fixed handling of time zones. 2005-02-01 Sven de Marothy * java/util/Calendar.java - (clear): Set values to Epoch instead of zero. - (set): Set isSet to the relevant field pattern instead of just the + (clear): Set values to Epoch instead of zero. + (set): Set isSet to the relevant field pattern instead of just the field. - * java/util/GregorianCalendar.java - (getBundle): Removed. - (getDayOfYear): Removed. - (getFirstDayOfMonth): New private method. - (nonLeniencyCheck): New private method. - (computeTime): Correct handling of insufficient data. + * java/util/GregorianCalendar.java + (getBundle): Removed. + (getDayOfYear): Removed. + (getFirstDayOfMonth): New private method. + (nonLeniencyCheck): New private method. + (computeTime): Correct handling of insufficient data. 2005-02-01 Andrew John Hughes Index: configure.ac =================================================================== RCS file: /cvsroot/classpath/classpath/configure.ac,v retrieving revision 1.43.2.5 diff -u -3 -p -u -r1.43.2.5 configure.ac --- configure.ac 16 Jan 2005 15:14:52 -0000 1.43.2.5 +++ configure.ac 15 Feb 2005 20:55:10 -0000 @@ -91,12 +91,16 @@ dnl ------------------------------------ AC_ARG_ENABLE([gtk-cairo], [AS_HELP_STRING(--enable-gtk-cairo,build the cairo Graphics2D implementation on GTK [default=no])], [case "${enableval}" in - yes) GTK_CAIRO=yes ;; - no) GTK_CAIRO=no ;; - *) GTK_CAIRO=yes ;; + yes) GTK_CAIRO_ENABLED=true ;; + no) GTK_CAIRO_ENABLED=false ;; + *) GTK_CAIRO_ENABLED=true ;; esac], - [GTK_CAIRO=no]) -AM_CONDITIONAL(GTK_CAIRO, test "x${enable_gtk_cairo}" = xyes) + [GTK_CAIRO_ENABLED=false]) +AC_SUBST(GTK_CAIRO_ENABLED) +if test "x${GTK_CAIRO_ENABLED}" = xtrue; then + AC_DEFINE(GTK_CAIRO, 1, [defined if cairo support was built in]) +fi +AM_CONDITIONAL(GTK_CAIRO, test "x${GTK_CAIRO_ENABLED}" = xtrue) dnl ----------------------------------------------------------- dnl Regenerate headers at build time (disabled by default) Index: examples/Makefile.am =================================================================== RCS file: /cvsroot/classpath/classpath/examples/Makefile.am,v retrieving revision 1.1.2.3 diff -u -3 -p -u -r1.1.2.3 Makefile.am --- examples/Makefile.am 2 Feb 2005 01:56:01 -0000 1.1.2.3 +++ examples/Makefile.am 15 Feb 2005 20:55:10 -0000 @@ -1,9 +1,6 @@ ## Input file for automake to generate the Makefile.in used by configure # Setup the compiler to use the GNU Classpath library we just build -if FOUND_ECJ -JCOMPILER = $(ECJ) -1.5 -bootclasspath '$(top_builddir)/lib' -classpath . -else if FOUND_GCJ JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C else @@ -13,6 +10,9 @@ else if FOUND_GCJX JCOMPILER = $(GCJX) -bootclasspath '' -sourcepath '' -classpath $(top_builddir)/lib:. else +if FOUND_ECJ +JCOMPILER = $(ECJ) -1.5 -bootclasspath '$(top_builddir)/lib' -classpath . +else error dunno how to setup the JCOMPILER and compile endif endif Index: gnu/classpath/Configuration.java.in =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/classpath/Configuration.java.in,v retrieving revision 1.12.2.1 diff -u -3 -p -u -r1.12.2.1 Configuration.java.in --- gnu/classpath/Configuration.java.in 16 Jan 2005 02:14:45 -0000 1.12.2.1 +++ gnu/classpath/Configuration.java.in 15 Feb 2005 20:55:10 -0000 @@ -1,6 +1,5 @@ -/* -*-java-*- */ -/* gnu.classpath.Configuration - Copyright (C) 1998, 2001, 2003 Free Software Foundation, Inc. +/* Configuration.java -- + Copyright (C) 1998, 2001, 2003, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -123,4 +122,10 @@ public interface Configuration */ boolean JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@; + + /** + * Set to true if Cairo was found and enabled during configure, + * false otherwise. + */ + boolean GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@; } Index: gnu/java/awt/color/ClutProfileConverter.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/color/ClutProfileConverter.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 ClutProfileConverter.java --- gnu/java/awt/color/ClutProfileConverter.java 15 Jan 2005 17:01:39 -0000 1.1.2.1 +++ gnu/java/awt/color/ClutProfileConverter.java 15 Feb 2005 20:55:10 -0000 @@ -38,7 +38,6 @@ package gnu.java.awt.color; -import java.awt.color.ColorSpace; import java.awt.color.ICC_Profile; Index: gnu/java/awt/peer/ClasspathTextLayoutPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/ClasspathTextLayoutPeer.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 ClasspathTextLayoutPeer.java --- gnu/java/awt/peer/ClasspathTextLayoutPeer.java 15 Jan 2005 17:01:40 -0000 1.1.2.1 +++ gnu/java/awt/peer/ClasspathTextLayoutPeer.java 15 Feb 2005 20:55:10 -0000 @@ -38,19 +38,12 @@ exception statement from your version. * package gnu.java.awt.peer; -import java.awt.Font; import java.awt.Graphics2D; import java.awt.Shape; import java.awt.font.TextHitInfo; import java.awt.font.TextLayout; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; -import java.text.CharacterIterator; -import java.text.AttributedCharacterIterator; -import java.text.AttributedString; -import java.util.Map; -import java.awt.font.TextAttribute; - /** * @author Graydon Hoare Index: gnu/java/awt/peer/gtk/GdkFontMetrics.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkFontMetrics.java,v retrieving revision 1.9.2.1 diff -u -3 -p -u -r1.9.2.1 GdkFontMetrics.java --- gnu/java/awt/peer/gtk/GdkFontMetrics.java 15 Jan 2005 17:01:40 -0000 1.9.2.1 +++ gnu/java/awt/peer/gtk/GdkFontMetrics.java 15 Feb 2005 20:55:11 -0000 @@ -63,8 +63,6 @@ public class GdkFontMetrics extends Font static final int TEXT_METRICS_X_ADVANCE = 4; static final int TEXT_METRICS_Y_ADVANCE = 5; - static native void getPeerFontMetrics(GdkFontPeer peer, double [] metrics); - static native void getPeerTextMetrics(GdkFontPeer peer, String str, double [] metrics); public GdkFontMetrics (Font font) { @@ -77,12 +75,7 @@ public class GdkFontMetrics extends Font font_metrics = new int[5]; double [] hires = new double[5]; - - if (GtkToolkit.useGraphics2D ()) - GdkGraphics2D.getPeerFontMetrics(peer, hires); - else - getPeerFontMetrics (peer, hires); - + peer.getFontMetrics (hires); for (int i = 0; i < 5; ++i) font_metrics[i] = (int) hires[i]; } @@ -90,10 +83,7 @@ public class GdkFontMetrics extends Font public int stringWidth (String str) { double [] hires = new double[6]; - if (GtkToolkit.useGraphics2D()) - GdkGraphics2D.getPeerTextMetrics(peer, str, hires); - else - getPeerTextMetrics(peer, str, hires); + peer.getTextMetrics(str, hires); return (int) hires [TEXT_METRICS_WIDTH]; } @@ -115,7 +105,6 @@ public class GdkFontMetrics extends Font public int getLeading () { return 1; -// return metrics[ASCENT] + metrics[DESCENT]; } public int getAscent () Index: gnu/java/awt/peer/gtk/GdkFontPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkFontPeer.java,v retrieving revision 1.3.2.2 diff -u -3 -p -u -r1.3.2.2 GdkFontPeer.java --- gnu/java/awt/peer/gtk/GdkFontPeer.java 16 Jan 2005 02:14:45 -0000 1.3.2.2 +++ gnu/java/awt/peer/gtk/GdkFontPeer.java 15 Feb 2005 20:55:11 -0000 @@ -37,19 +37,21 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import java.awt.peer.FontPeer; -import java.awt.*; -import java.awt.geom.*; -import java.awt.font.*; + +import gnu.classpath.Configuration; +import gnu.java.awt.peer.ClasspathFontPeer; + +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.font.LineMetrics; +import java.awt.geom.Rectangle2D; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; -import java.util.MissingResourceException; import java.text.CharacterIterator; -import java.text.AttributedCharacterIterator; import java.text.StringCharacterIterator; -import gnu.classpath.Configuration; -import gnu.java.awt.peer.ClasspathFontPeer; public class GdkFontPeer extends ClasspathFontPeer { @@ -81,6 +83,9 @@ public class GdkFontPeer extends Classpa private native void dispose (); private native void setFont (String family, int style, int size, boolean useGraphics2D); + native void getFontMetrics(double [] metrics); + native void getTextMetrics(String str, double [] metrics); + protected void finalize () { if (GtkToolkit.useGraphics2D ()) @@ -158,26 +163,33 @@ public class GdkFontPeer extends Classpa public boolean canDisplay (Font font, char c) { - throw new UnsupportedOperationException (); + // FIXME: inquire with pango + return true; } public int canDisplayUpTo (Font font, CharacterIterator i, int start, int limit) { - throw new UnsupportedOperationException (); + // FIXME: inquire with pango + return -1; } + + private native GdkGlyphVector getGlyphVector(String txt, + Font f, + FontRenderContext ctx); public GlyphVector createGlyphVector (Font font, FontRenderContext ctx, CharacterIterator i) { - return new GdkGlyphVector(font, this, ctx, buildString (i)); + return getGlyphVector(buildString (i), font, ctx); } public GlyphVector createGlyphVector (Font font, FontRenderContext ctx, int[] glyphCodes) { - return new GdkGlyphVector (font, this, ctx, glyphCodes); + return null; + // return new GdkGlyphVector (font, this, ctx, glyphCodes); } public byte getBaselineFor (Font font, char c) @@ -259,7 +271,8 @@ public class GdkFontPeer extends Classpa public Rectangle2D getStringBounds (Font font, CharacterIterator ci, int begin, int limit, FontRenderContext frc) { - throw new UnsupportedOperationException (); + GdkGlyphVector gv = getGlyphVector(buildString (ci, begin, limit), font, frc); + return gv.getVisualBounds(); } public boolean hasUniformLineMetrics (Font font) Index: gnu/java/awt/peer/gtk/GdkGlyphVector.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkGlyphVector.java,v retrieving revision 1.2.2.1 diff -u -3 -p -u -r1.2.2.1 GdkGlyphVector.java --- gnu/java/awt/peer/gtk/GdkGlyphVector.java 15 Jan 2005 17:01:40 -0000 1.2.2.1 +++ gnu/java/awt/peer/gtk/GdkGlyphVector.java 15 Feb 2005 20:55:11 -0000 @@ -38,8 +38,6 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import gnu.classpath.Configuration; - import java.awt.Font; import java.awt.Rectangle; import java.awt.Shape; @@ -54,36 +52,57 @@ import java.awt.geom.Rectangle2D; public class GdkGlyphVector extends GlyphVector { - static + /* We use a simple representation for glyph vectors here. Glyph i + * consumes 8 doubles: + * + * logical x: extents[ 10*i ] + * logical y: extents[ 10*i + 1 ] + * logical width: extents[ 10*i + 2 ] + * logical height: extents[ 10*i + 3 ] + * + * visual x: extents[ 10*i + 4 ] + * visual y: extents[ 10*i + 5 ] + * visual width: extents[ 10*i + 6 ] + * visual height: extents[ 10*i + 7 ] + * + * origin pos x: extents[ 10*i + 8 ] + * origin pos y: extents[ 10*i + 9 ] + * + * as well as one int, code[i], representing the glyph code in the font. + */ + + double [] extents; + int [] codes; + + Font font; + FontRenderContext fontRenderContext; + + Rectangle2D allLogical; + Rectangle2D allVisual; + + public GdkGlyphVector(double[] extents, int[] codes, Font font, FontRenderContext frc) { - if (Configuration.INIT_LOAD_LIBRARY) + this.extents = extents; + this.codes = codes; + this.font = font; + this.fontRenderContext = frc; + + allLogical = new Rectangle2D.Double(); + allVisual = new Rectangle2D.Double(); + + for (int i = 0; i < codes.length; ++i) { - System.loadLibrary("gtkpeer"); + allLogical.add (new Rectangle2D.Double(extents[10*i ] + extents[10*i + 8], + extents[10*i + 1] + extents[10*i + 9], + extents[10*i + 2], + extents[10*i + 3])); + + allVisual.add (new Rectangle2D.Double(extents[10*i + 4] + extents[10*i + 8], + extents[10*i + 5] + extents[10*i + 9], + extents[10*i + 6], + extents[10*i + 7])); } - - if (GtkToolkit.useGraphics2D ()) - initStaticState (); } - native static void initStaticState (); - private final int native_state = GtkGenericPeer.getUniqueInteger (); - - private Font font; - private FontRenderContext ctx; - - private native void initState (GdkFontPeer peer, FontRenderContext ctx); - private native void setChars (String s); - private native void setGlyphCodes (int codes[]); - private native void dispose (); - private native int glyphCode (int idx); - private native int numGlyphs (); - private native int glyphCharIndex (int idx); - private native double[] allLogicalExtents (); - private native double[] allInkExtents (); - private native double[] glyphLogicalExtents (int idx); - private native double[] glyphInkExtents (int idx); - private native boolean glyphIsHorizontal (int idx); - private native boolean isEqual (GdkGlyphVector ggv); - /* geometric notes: @@ -108,26 +127,14 @@ public class GdkGlyphVector extends Glyp */ - - public GdkGlyphVector (Font f, GdkFontPeer peer, FontRenderContext c, String s) + public double[] getExtents() { - font = f; - ctx = c; - initState (peer, ctx); - setChars (s); + return extents; } - public GdkGlyphVector (Font f, GdkFontPeer peer, FontRenderContext c, int codes[]) + public int[] getCodes() { - font = f; - ctx = c; - initState (peer, ctx); - setGlyphCodes (codes); - } - - protected void finalize () - { - dispose (); + return codes; } public Font getFont () @@ -137,12 +144,15 @@ public class GdkGlyphVector extends Glyp public FontRenderContext getFontRenderContext () { - return ctx; + return fontRenderContext; } public int getGlyphCharIndex (int glyphIndex) { - return glyphCharIndex (glyphIndex); + // FIXME: currently pango does not provide glyph-by-glyph + // reverse mapping information, so we assume a broken 1:1 + // glyph model here. This is plainly wrong. + return glyphIndex; } public int[] getGlyphCharIndices (int beginGlyphIndex, @@ -154,50 +164,44 @@ public class GdkGlyphVector extends Glyp ix = new int[numEntries]; for (int i = 0; i < numEntries; i++) - ix[i] = glyphCharIndex (beginGlyphIndex + i); + ix[i] = getGlyphCharIndex (beginGlyphIndex + i); return ix; } public int getGlyphCode (int glyphIndex) { - return glyphCode (glyphIndex); + return codes[glyphIndex]; } public int[] getGlyphCodes (int beginGlyphIndex, int numEntries, int[] codeReturn) { - int ix[] = codeReturn; - if (ix == null) - ix = new int[numEntries]; + if (codeReturn == null) + codeReturn = new int[numEntries]; - for (int i = 0; i < numEntries; i++) - ix[i] = glyphCode (beginGlyphIndex + i); - return ix; + System.arraycopy(codes, beginGlyphIndex, codeReturn, 0, numEntries); + return codeReturn; } - public Shape getGlyphLogicalBounds (int glyphIndex) + public Shape getGlyphLogicalBounds (int i) { - double extents[] = glyphLogicalExtents (glyphIndex); - return new Rectangle2D.Double (extents[0], extents[1], - extents[2], extents[3]); + return new Rectangle2D.Double (extents[8*i], extents[8*i + 1], + extents[8*i + 2], extents[8*i + 3]); } - public GlyphMetrics getGlyphMetrics (int glyphIndex) + public GlyphMetrics getGlyphMetrics (int i) { - double extents[] = glyphLogicalExtents (glyphIndex); - Rectangle2D log_bounds = new Rectangle2D.Double (extents[0], extents[1], - extents[2], extents[3]); - - extents = glyphInkExtents (glyphIndex); - Rectangle2D ink_bounds = new Rectangle2D.Double (extents[0], extents[1], - extents[2], extents[3]); - - boolean is_horizontal = glyphIsHorizontal (glyphIndex); - - return new GlyphMetrics (is_horizontal, - (float)(log_bounds.getWidth() + log_bounds.getX()), - (float)(log_bounds.getHeight() + log_bounds.getY()), - ink_bounds, GlyphMetrics.STANDARD); + // FIXME: pango does not yield vertical layout information at the + // moment. + + boolean is_horizontal = true; + double advanceX = extents[8*i + 2]; // "logical width" == advanceX + double advanceY = 0; + + return new GlyphMetrics (is_horizontal, + (float) advanceX, (float) advanceY, + (Rectangle2D) getGlyphVisualBounds(i), + GlyphMetrics.STANDARD); } public Shape getGlyphOutline (int glyphIndex) @@ -210,20 +214,18 @@ public class GdkGlyphVector extends Glyp throw new UnsupportedOperationException (); } - public Rectangle getGlyphPixelBounds (int glyphIndex, + public Rectangle getGlyphPixelBounds (int i, FontRenderContext renderFRC, float x, float y) { - double extents[] = glyphInkExtents(glyphIndex); - return new Rectangle ((int)x, (int)y, (int)extents[2], (int)extents[3]); + return new Rectangle((int) x, (int) y, + (int) extents[8*i + 6], (int) extents[8*i + 7]); } - public Point2D getGlyphPosition (int glyphIndex) + public Point2D getGlyphPosition (int i) { - float[] ret = new float[2 * (glyphIndex + 1)]; - getGlyphPositions (0, glyphIndex + 1, ret); - return new Point2D.Float (ret[2 * glyphIndex], - ret[2 * glyphIndex + 1]); + return new Point2D.Double (extents[10*i + 8], + extents[10*i + 9]); } public float[] getGlyphPositions (int beginGlyphIndex, @@ -234,35 +236,25 @@ public class GdkGlyphVector extends Glyp if (fx == null) fx = new float[numEntries * 2]; - - float x = 0.0f; - float y = 0.0f; for (int i = 0; i < numEntries; ++i) { - boolean is_horizontal = glyphIsHorizontal (beginGlyphIndex + i); - double log_extents[] = glyphLogicalExtents (beginGlyphIndex + i); - fx[2*i] = x + (float)log_extents[0]; // x offset - fx[2*i + 1] = y + (float)log_extents[1]; // y offset - if (is_horizontal) - x += (float)log_extents[2]; // x advance ("logical width") in pango-ese - else - y += (float)log_extents[3]; // y advance ("logical height") in pango-ese + fx[2*i ] = (float) extents[10*i + 8]; + fx[2*i + 1] = (float) extents[10*i + 9]; } return fx; } public AffineTransform getGlyphTransform (int glyphIndex) { - // glyphs don't have independent transforms in these simple glyph + // Glyphs don't have independent transforms in these simple glyph // vectors; docs specify null is an ok return here. return null; } - public Shape getGlyphVisualBounds (int glyphIndex) + public Shape getGlyphVisualBounds (int i) { - double extents[] = glyphInkExtents (glyphIndex); - return new Rectangle2D.Double (extents[0], extents[1], - extents[2], extents[3]); + return new Rectangle2D.Double(extents[8*i + 4], extents[8*i + 5], + extents[8*i + 6], extents[8*i + 7]); } public int getLayoutFlags () @@ -272,14 +264,12 @@ public class GdkGlyphVector extends Glyp public Rectangle2D getLogicalBounds () { - double extents[] = allLogicalExtents (); - return new Rectangle2D.Double (extents[0], extents[1], - extents[2], extents[3]); + return allLogical; } public int getNumGlyphs () { - return numGlyphs (); + return codes.length; } public Shape getOutline () @@ -290,26 +280,28 @@ public class GdkGlyphVector extends Glyp public Rectangle getPixelBounds (FontRenderContext renderFRC, float x, float y) { - double extents[] = allInkExtents(); - return new Rectangle ((int)x, (int)y, - (int)extents[2], (int)extents[3]); + return new Rectangle((int)x, + (int)y, + (int) allVisual.getWidth(), + (int) allVisual.getHeight()); } public Rectangle2D getVisualBounds () { - double extents[] = allInkExtents(); - return new Rectangle2D.Double (extents[0], extents[1], - extents[2], extents[3]); + return allVisual; } public void performDefaultLayout () { } - public void setGlyphPosition (int glyphIndex, Point2D newPos) + public void setGlyphPosition (int i, Point2D newPos) { - // should we be ok twiddling pango's structure here? - throw new UnsupportedOperationException (); + extents[8*i ] = newPos.getX(); + extents[8*i + 1] = newPos.getY(); + + extents[8*i + 4] = newPos.getX(); + extents[8*i + 5] = newPos.getY(); } public void setGlyphTransform (int glyphIndex, @@ -327,8 +319,31 @@ public class GdkGlyphVector extends Glyp if (! (gv instanceof GdkGlyphVector)) return false; - GdkGlyphVector ggv = (GdkGlyphVector)gv; - return isEqual(ggv); + GdkGlyphVector ggv = (GdkGlyphVector) gv; + + if ((ggv.codes.length != this.codes.length) + || (ggv.extents.length != this.extents.length)) + return false; + + if ((ggv.font == null && this.font != null) + || (ggv.font != null && this.font == null) + || (!ggv.font.equals(this.font))) + return false; + + if ((ggv.fontRenderContext == null && this.fontRenderContext != null) + || (ggv.fontRenderContext != null && this.fontRenderContext == null) + || (!ggv.fontRenderContext.equals(this.fontRenderContext))) + return false; + + for (int i = 0; i < ggv.codes.length; ++i) + if (ggv.codes[i] != this.codes[i]) + return false; + + for (int i = 0; i < ggv.extents.length; ++i) + if (ggv.extents[i] != this.extents[i]) + return false; + + return true; } public GlyphJustificationInfo getGlyphJustificationInfo(int idx) Index: gnu/java/awt/peer/gtk/GdkGraphics2D.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkGraphics2D.java,v retrieving revision 1.15.2.4 diff -u -3 -p -u -r1.15.2.4 GdkGraphics2D.java --- gnu/java/awt/peer/gtk/GdkGraphics2D.java 16 Jan 2005 15:15:01 -0000 1.15.2.4 +++ gnu/java/awt/peer/gtk/GdkGraphics2D.java 15 Feb 2005 20:55:11 -0000 @@ -1,5 +1,5 @@ -/* GdkGraphics2D.java - Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* GdkGraphics2D.java -- + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -40,7 +40,6 @@ package gnu.java.awt.peer.gtk; import gnu.classpath.Configuration; import gnu.java.awt.ClasspathToolkit; -import gnu.java.awt.peer.ClasspathFontPeer; import java.awt.AlphaComposite; import java.awt.BasicStroke; @@ -60,9 +59,7 @@ import java.awt.Shape; import java.awt.Stroke; import java.awt.TexturePaint; import java.awt.Toolkit; -import java.awt.color.ColorSpace; import java.awt.font.FontRenderContext; -import java.awt.font.GlyphJustificationInfo; import java.awt.font.GlyphVector; import java.awt.geom.AffineTransform; import java.awt.geom.Arc2D; @@ -80,7 +77,6 @@ import java.awt.image.DataBuffer; import java.awt.image.DataBufferInt; import java.awt.image.DirectColorModel; import java.awt.image.FilteredImageSource; -import java.awt.image.ImageConsumer; import java.awt.image.ImageObserver; import java.awt.image.ImagingOpException; import java.awt.image.MultiPixelPackedSampleModel; @@ -103,6 +99,10 @@ public class GdkGraphics2D extends Graph static { + if (! Configuration.GTK_CAIRO_ENABLED) + throw new Error("Grahics2D not implemented. " + + "Cairo was not found or disabled at configure time"); + if (Configuration.INIT_LOAD_LIBRARY) System.loadLibrary("gtkpeer"); @@ -211,9 +211,7 @@ public class GdkGraphics2D extends Graph GdkGraphics2D(GtkComponentPeer component) { this.component = component; - - setFont(new Font("SansSerif", Font.PLAIN, 12)); - + if (component.isRealized()) initComponentGraphics2D(); else @@ -230,6 +228,7 @@ public class GdkGraphics2D extends Graph setTransform(new AffineTransform()); setStroke(new BasicStroke()); setRenderingHints(getDefaultHints()); + setFont(new Font("SansSerif", Font.PLAIN, 12)); stateStack = new Stack(); } @@ -1322,58 +1321,54 @@ public class GdkGraphics2D extends Graph } // these are the most accelerated painting paths - native void cairoDrawGdkGlyphVector(GdkFontPeer f, GdkGlyphVector gv, - float x, float y); + native void cairoDrawGlyphVector(GdkFontPeer font, + float x, float y, int n, + int[] codes, float[] positions); - native void cairoDrawGdkTextLayout(GdkFontPeer f, GdkTextLayout gl, float x, - float y); - - native void cairoDrawString(GdkFontPeer f, String str, float x, float y); + native void cairoDrawGdkTextLayout(GdkTextLayout gl, + float x, float y); GdkFontPeer getFontPeer() { return (GdkFontPeer) getFont().getPeer(); } - public void drawGdkGlyphVector(GdkGlyphVector gv, float x, float y) - { - cairoDrawGdkGlyphVector(getFontPeer(), gv, x, y); - updateBufferedImage(); - } - public void drawGdkTextLayout(GdkTextLayout gl, float x, float y) { - cairoDrawGdkTextLayout(getFontPeer(), gl, x, y); - updateBufferedImage(); + cairoDrawGdkTextLayout (gl, x, y); + updateBufferedImage (); } public void drawString(String str, float x, float y) { - cairoDrawString(getFontPeer(), str, x, y); - updateBufferedImage(); + drawGlyphVector(getFont().createGlyphVector(null, str), x, y); + updateBufferedImage (); } public void drawString(String str, int x, int y) { - drawString(str, (float) x, (float) y); + drawString (str, (float) x, (float) y); } public void drawString(AttributedCharacterIterator ci, int x, int y) { - drawString(ci, (float) x, (float) y); + drawString (ci, (float) x, (float) y); } public void drawGlyphVector(GlyphVector gv, float x, float y) { - if (gv instanceof GdkGlyphVector) - drawGdkGlyphVector((GdkGlyphVector) gv, x, y); - else - throw new java.lang.UnsupportedOperationException(); + int n = gv.getNumGlyphs (); + int[] codes = gv.getGlyphCodes (0, n, null); + float[] positions = gv.getGlyphPositions (0, n, null); + + setFont (gv.getFont ()); + cairoDrawGlyphVector (getFontPeer(), x, y, n, codes, positions); + updateBufferedImage (); } public void drawString(AttributedCharacterIterator ci, float x, float y) { - GlyphVector gv = font.createGlyphVector(getFontRenderContext(), ci); + GlyphVector gv = getFont().createGlyphVector(getFontRenderContext(), ci); drawGlyphVector(gv, x, y); } @@ -1412,6 +1407,8 @@ public class GdkGraphics2D extends Graph public Font getFont() { + if (font == null) + return new Font("SansSerif", Font.PLAIN, 12); return font; } @@ -1421,16 +1418,9 @@ public class GdkGraphics2D extends Graph static native void releasePeerGraphicsResource(GdkFontPeer f); - static native void getPeerTextMetrics(GdkFontPeer f, String str, - double[] metrics); - - static native void getPeerFontMetrics(GdkFontPeer f, double[] metrics); - public FontMetrics getFontMetrics() { - // the reason we go via the toolkit here is to try to get - // a cached object. the toolkit keeps such a cache. - return Toolkit.getDefaultToolkit().getFontMetrics(font); + return getFontMetrics(getFont()); } public FontMetrics getFontMetrics(Font f) @@ -1453,7 +1443,7 @@ public class GdkGraphics2D extends Graph public String toString() { return (getClass().getName() - + "[font=" + font.toString() + + "[font=" + getFont().toString() + ",color=" + fg.toString() + "]"); } Index: gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java =================================================================== RCS file: gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java diff -N gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java 15 Feb 2005 20:55:11 -0000 @@ -0,0 +1,138 @@ +/* GdkGraphicsConfiguration.java -- describes characteristics of graphics + Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.java.awt.peer.gtk; + +import java.awt.BufferCapabilities; +import java.awt.ImageCapabilities; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.Rectangle; + +import java.awt.geom.AffineTransform; + +import java.awt.image.BufferedImage; +import java.awt.image.ColorModel; +import java.awt.image.VolatileImage; + +public class GdkGraphicsConfiguration + extends GraphicsConfiguration +{ + GdkScreenGraphicsDevice gdkScreenGraphicsDevice; + ColorModel cm; + Rectangle bounds; + + public GtkToolkit getToolkit() + { + return gdkScreenGraphicsDevice.getToolkit(); + } + + public GdkGraphicsConfiguration(GdkScreenGraphicsDevice dev) + { + this.gdkScreenGraphicsDevice = dev; + cm = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).getColorModel(); + bounds = getToolkit().getBounds(); + } + + public GraphicsDevice getDevice() + { + return gdkScreenGraphicsDevice; + } + + public BufferedImage createCompatibleImage(int w, int h) + { + return new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); + } + + public BufferedImage createCompatibleImage(int w, int h, + int transparency) + { + return createCompatibleImage(w, h); + } + + public VolatileImage createCompatibleVolatileImage(int w, int h) + { + throw new java.lang.UnsupportedOperationException (); + } + + public VolatileImage createCompatibleVolatileImage(int w, int h, + ImageCapabilities caps) + throws java.awt.AWTException + { + throw new java.lang.UnsupportedOperationException (); + } + + public ColorModel getColorModel() + { + return cm; + } + + public ColorModel getColorModel(int transparency) + { + return getColorModel(); + } + + public AffineTransform getDefaultTransform() + { + // FIXME: extract the GDK DPI information here. + return new AffineTransform(); + } + + public AffineTransform getNormalizingTransform() + { + // FIXME: extract the GDK DPI information here. + return new AffineTransform(); + } + + public Rectangle getBounds() + { + return bounds; + } + + public BufferCapabilities getBufferCapabilities() + { + return new BufferCapabilities(getImageCapabilities(), + getImageCapabilities(), + BufferCapabilities.FlipContents.UNDEFINED); + } + + public ImageCapabilities getImageCapabilities() + { + return new ImageCapabilities(false); + } + +} Index: gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java,v retrieving revision 1.1.2.2 diff -u -3 -p -u -r1.1.2.2 GdkGraphicsEnvironment.java --- gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java 16 Jan 2005 15:15:01 -0000 1.1.2.2 +++ gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java 15 Feb 2005 20:55:11 -0000 @@ -43,21 +43,28 @@ import java.awt.Graphics2D; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; -import java.awt.Rectangle; -import java.awt.Shape; import java.awt.image.BufferedImage; import java.util.Locale; public class GdkGraphicsEnvironment extends GraphicsEnvironment { - public GdkGraphicsEnvironment () + GtkToolkit gtkToolkit; + + public GtkToolkit getToolkit() + { + return gtkToolkit; + } + + public GdkGraphicsEnvironment (GtkToolkit tk) { super(); + gtkToolkit = tk; } public GraphicsDevice[] getScreenDevices () { - throw new java.lang.UnsupportedOperationException (); + // FIXME: Support multiple screens, since GDK can. + return new GraphicsDevice[] { new GdkScreenGraphicsDevice (this) }; } public GraphicsDevice getDefaultScreenDevice () @@ -65,7 +72,7 @@ public class GdkGraphicsEnvironment exte if (GraphicsEnvironment.isHeadless ()) throw new HeadlessException (); - return new GdkScreenGraphicsDevice (); + return new GdkScreenGraphicsDevice (this); } public Graphics2D createGraphics (BufferedImage image) Index: gnu/java/awt/peer/gtk/GdkPixbufDecoder.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java,v retrieving revision 1.6.2.2 diff -u -3 -p -u -r1.6.2.2 GdkPixbufDecoder.java --- gnu/java/awt/peer/gtk/GdkPixbufDecoder.java 16 Jan 2005 15:15:01 -0000 1.6.2.2 +++ gnu/java/awt/peer/gtk/GdkPixbufDecoder.java 15 Feb 2005 20:55:11 -0000 @@ -42,16 +42,12 @@ import gnu.classpath.Configuration; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; -import java.awt.image.DataBufferInt; import java.awt.image.DirectColorModel; import java.awt.image.ImageConsumer; import java.awt.image.ImageProducer; import java.awt.image.Raster; import java.awt.image.RenderedImage; -import java.awt.image.WritableRaster; import java.io.DataOutput; -import java.io.FileDescriptor; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -176,7 +172,11 @@ public class GdkPixbufDecoder extends gn } curr = null; - finish(); + } + + public void finalize() + { + finish(); } Index: gnu/java/awt/peer/gtk/GdkRobotPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkRobotPeer.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 GdkRobotPeer.java --- gnu/java/awt/peer/gtk/GdkRobotPeer.java 16 Jan 2005 15:15:01 -0000 1.1.2.1 +++ gnu/java/awt/peer/gtk/GdkRobotPeer.java 15 Feb 2005 20:55:11 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; import java.awt.AWTException; -import java.awt.Color; import java.awt.GraphicsDevice; import java.awt.image.ColorModel; import java.awt.image.DirectColorModel; Index: gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 GdkScreenGraphicsDevice.java --- gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java 16 Jan 2005 15:15:01 -0000 1.1.2.1 +++ gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java 15 Feb 2005 20:55:11 -0000 @@ -43,9 +43,17 @@ import java.awt.GraphicsConfiguration; public class GdkScreenGraphicsDevice extends GraphicsDevice { - public GdkScreenGraphicsDevice () + GdkGraphicsEnvironment env; + + public GtkToolkit getToolkit() { + return env.getToolkit(); + } + + public GdkScreenGraphicsDevice (GdkGraphicsEnvironment e) + { super (); + env = e; } public int getType () @@ -62,12 +70,13 @@ public class GdkScreenGraphicsDevice ext public GraphicsConfiguration[] getConfigurations () { // FIXME: query X for the list of possible configurations - return null; + return new GraphicsConfiguration [] { new GdkGraphicsConfiguration(this) }; } public GraphicsConfiguration getDefaultConfiguration () { + // FIXME: query X for default configuration - return null; + return new GdkGraphicsConfiguration(this); } } Index: gnu/java/awt/peer/gtk/GdkTextLayout.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkTextLayout.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 GdkTextLayout.java --- gnu/java/awt/peer/gtk/GdkTextLayout.java 15 Jan 2005 17:01:41 -0000 1.1.2.1 +++ gnu/java/awt/peer/gtk/GdkTextLayout.java 15 Feb 2005 20:55:12 -0000 @@ -52,7 +52,6 @@ import java.awt.geom.Rectangle2D; import java.text.CharacterIterator; import java.text.AttributedCharacterIterator; import java.text.AttributedString; -import java.util.Map; import java.awt.font.TextAttribute; import gnu.classpath.Configuration; Index: gnu/java/awt/peer/gtk/GtkButtonPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkButtonPeer.java,v retrieving revision 1.30.2.2 diff -u -3 -p -u -r1.30.2.2 GtkButtonPeer.java --- gnu/java/awt/peer/gtk/GtkButtonPeer.java 15 Jan 2005 17:01:41 -0000 1.30.2.2 +++ gnu/java/awt/peer/gtk/GtkButtonPeer.java 15 Feb 2005 20:55:12 -0000 @@ -41,7 +41,6 @@ package gnu.java.awt.peer.gtk; import java.awt.AWTEvent; import java.awt.Button; import java.awt.Component; -import java.awt.Font; import java.awt.Point; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; Index: gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 GtkCheckboxMenuItemPeer.java --- gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java 9 Jul 2003 10:25:34 -0000 1.5 +++ gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java 15 Feb 2005 20:55:12 -0000 @@ -38,9 +38,10 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; +import java.awt.ItemSelectable; +import java.awt.event.ItemEvent; import java.awt.CheckboxMenuItem; import java.awt.peer.CheckboxMenuItemPeer; -import java.awt.peer.MenuItemPeer; public class GtkCheckboxMenuItemPeer extends GtkMenuItemPeer implements CheckboxMenuItemPeer @@ -54,4 +55,15 @@ public class GtkCheckboxMenuItemPeer ext } native public void setState (boolean t); + + protected void postMenuActionEvent () + { + CheckboxMenuItem item = (CheckboxMenuItem)awtWidget; + q().postEvent (new ItemEvent ((ItemSelectable)awtWidget, + ItemEvent.ITEM_STATE_CHANGED, + item.getActionCommand(), + item.getState() ? ItemEvent.DESELECTED : ItemEvent.SELECTED)); + + super.postMenuActionEvent(); + } } Index: gnu/java/awt/peer/gtk/GtkCheckboxPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java,v retrieving revision 1.18.2.1 diff -u -3 -p -u -r1.18.2.1 GtkCheckboxPeer.java --- gnu/java/awt/peer/gtk/GtkCheckboxPeer.java 14 Jan 2005 10:24:04 -0000 1.18.2.1 +++ gnu/java/awt/peer/gtk/GtkCheckboxPeer.java 15 Feb 2005 20:55:12 -0000 @@ -40,8 +40,6 @@ package gnu.java.awt.peer.gtk; import java.awt.Checkbox; import java.awt.CheckboxGroup; -import java.awt.Component; -import java.awt.Font; import java.awt.peer.CheckboxPeer; public class GtkCheckboxPeer extends GtkComponentPeer Index: gnu/java/awt/peer/gtk/GtkChoicePeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkChoicePeer.java,v retrieving revision 1.17.2.1 diff -u -3 -p -u -r1.17.2.1 GtkChoicePeer.java --- gnu/java/awt/peer/gtk/GtkChoicePeer.java 15 Jan 2005 17:01:41 -0000 1.17.2.1 +++ gnu/java/awt/peer/gtk/GtkChoicePeer.java 15 Feb 2005 20:55:12 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import java.awt.AWTEvent; import java.awt.Choice; import java.awt.event.ItemEvent; import java.awt.peer.ChoicePeer; Index: gnu/java/awt/peer/gtk/GtkComponentPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java,v retrieving revision 1.70.2.4 diff -u -3 -p -u -r1.70.2.4 GtkComponentPeer.java --- gnu/java/awt/peer/gtk/GtkComponentPeer.java 16 Jan 2005 15:15:01 -0000 1.70.2.4 +++ gnu/java/awt/peer/gtk/GtkComponentPeer.java 15 Feb 2005 20:55:12 -0000 @@ -47,14 +47,12 @@ import java.awt.Cursor; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; -import java.awt.Frame; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.Image; import java.awt.Insets; import java.awt.ItemSelectable; -import java.awt.KeyboardFocusManager; import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; Index: gnu/java/awt/peer/gtk/GtkContainerPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkContainerPeer.java,v retrieving revision 1.25.2.1 diff -u -3 -p -u -r1.25.2.1 GtkContainerPeer.java --- gnu/java/awt/peer/gtk/GtkContainerPeer.java 15 Jan 2005 17:01:41 -0000 1.25.2.1 +++ gnu/java/awt/peer/gtk/GtkContainerPeer.java 15 Feb 2005 20:55:12 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import java.awt.AWTEvent; import java.awt.Color; import java.awt.Component; import java.awt.Container; @@ -46,7 +45,6 @@ import java.awt.Font; import java.awt.Graphics; import java.awt.Insets; import java.awt.Window; -import java.awt.event.PaintEvent; import java.awt.peer.ComponentPeer; import java.awt.peer.ContainerPeer; Index: gnu/java/awt/peer/gtk/GtkDialogPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkDialogPeer.java,v retrieving revision 1.21.2.3 diff -u -3 -p -u -r1.21.2.3 GtkDialogPeer.java --- gnu/java/awt/peer/gtk/GtkDialogPeer.java 16 Jan 2005 15:15:01 -0000 1.21.2.3 +++ gnu/java/awt/peer/gtk/GtkDialogPeer.java 15 Feb 2005 20:55:12 -0000 @@ -38,8 +38,6 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import java.awt.AWTEvent; -import java.awt.Component; import java.awt.Dialog; import java.awt.Graphics; import java.awt.Rectangle; Index: gnu/java/awt/peer/gtk/GtkFileDialogPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java,v retrieving revision 1.17.2.2 diff -u -3 -p -u -r1.17.2.2 GtkFileDialogPeer.java --- gnu/java/awt/peer/gtk/GtkFileDialogPeer.java 15 Jan 2005 17:01:41 -0000 1.17.2.2 +++ gnu/java/awt/peer/gtk/GtkFileDialogPeer.java 15 Feb 2005 20:55:12 -0000 @@ -38,12 +38,10 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import java.awt.AWTEvent; import java.awt.Dialog; import java.awt.FileDialog; import java.awt.Graphics; import java.awt.Window; -import java.awt.event.WindowEvent; import java.awt.peer.FileDialogPeer; import java.io.File; import java.io.FilenameFilter; Index: gnu/java/awt/peer/gtk/GtkFontPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkFontPeer.java,v retrieving revision 1.10.2.1 diff -u -3 -p -u -r1.10.2.1 GtkFontPeer.java --- gnu/java/awt/peer/gtk/GtkFontPeer.java 15 Jan 2005 17:01:41 -0000 1.10.2.1 +++ gnu/java/awt/peer/gtk/GtkFontPeer.java 15 Feb 2005 20:55:12 -0000 @@ -46,7 +46,6 @@ import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.font.LineMetrics; import java.awt.geom.Rectangle2D; -import java.awt.peer.FontPeer; import java.text.CharacterIterator; import java.util.Locale; import java.util.MissingResourceException; Index: gnu/java/awt/peer/gtk/GtkFramePeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java,v retrieving revision 1.25.2.4 diff -u -3 -p -u -r1.25.2.4 GtkFramePeer.java --- gnu/java/awt/peer/gtk/GtkFramePeer.java 16 Jan 2005 15:15:01 -0000 1.25.2.4 +++ gnu/java/awt/peer/gtk/GtkFramePeer.java 15 Feb 2005 20:55:12 -0000 @@ -38,11 +38,8 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import java.awt.Component; -import java.awt.Container; import java.awt.Frame; import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.Image; import java.awt.MenuBar; import java.awt.Rectangle; Index: gnu/java/awt/peer/gtk/GtkLabelPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkLabelPeer.java,v retrieving revision 1.18.2.2 diff -u -3 -p -u -r1.18.2.2 GtkLabelPeer.java --- gnu/java/awt/peer/gtk/GtkLabelPeer.java 15 Jan 2005 17:01:41 -0000 1.18.2.2 +++ gnu/java/awt/peer/gtk/GtkLabelPeer.java 15 Feb 2005 20:55:12 -0000 @@ -38,8 +38,6 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import java.awt.Component; -import java.awt.Font; import java.awt.Label; import java.awt.peer.LabelPeer; Index: gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java,v retrieving revision 1.6.2.1 diff -u -3 -p -u -r1.6.2.1 GtkMenuComponentPeer.java --- gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java 14 Jan 2005 10:24:04 -0000 1.6.2.1 +++ gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java 15 Feb 2005 20:55:12 -0000 @@ -38,8 +38,6 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import java.awt.Font; -import java.awt.MenuComponent; import java.awt.peer.MenuComponentPeer; public class GtkMenuComponentPeer extends GtkGenericPeer Index: gnu/java/awt/peer/gtk/GtkMenuItemPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java,v retrieving revision 1.10.2.2 diff -u -3 -p -u -r1.10.2.2 GtkMenuItemPeer.java --- gnu/java/awt/peer/gtk/GtkMenuItemPeer.java 15 Jan 2005 17:01:41 -0000 1.10.2.2 +++ gnu/java/awt/peer/gtk/GtkMenuItemPeer.java 15 Feb 2005 20:55:12 -0000 @@ -43,8 +43,6 @@ import java.awt.Menu; import java.awt.MenuComponent; import java.awt.MenuBar; import java.awt.MenuItem; -import java.awt.peer.MenuBarPeer; -import java.awt.peer.MenuComponentPeer; import java.awt.peer.MenuItemPeer; import java.awt.peer.MenuPeer; Index: gnu/java/awt/peer/gtk/GtkScrollPanePeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java,v retrieving revision 1.15.2.1 diff -u -3 -p -u -r1.15.2.1 GtkScrollPanePeer.java --- gnu/java/awt/peer/gtk/GtkScrollPanePeer.java 15 Jan 2005 17:01:42 -0000 1.15.2.1 +++ gnu/java/awt/peer/gtk/GtkScrollPanePeer.java 15 Feb 2005 20:55:12 -0000 @@ -41,7 +41,6 @@ package gnu.java.awt.peer.gtk; import java.awt.Adjustable; import java.awt.Dimension; import java.awt.ScrollPane; -import java.awt.peer.ComponentPeer; import java.awt.peer.ScrollPanePeer; public class GtkScrollPanePeer extends GtkContainerPeer Index: gnu/java/awt/peer/gtk/GtkTextComponentPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java,v retrieving revision 1.14.2.1 diff -u -3 -p -u -r1.14.2.1 GtkTextComponentPeer.java --- gnu/java/awt/peer/gtk/GtkTextComponentPeer.java 16 Jan 2005 15:15:01 -0000 1.14.2.1 +++ gnu/java/awt/peer/gtk/GtkTextComponentPeer.java 15 Feb 2005 20:55:12 -0000 @@ -38,11 +38,8 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; -import java.awt.AWTEvent; -import java.awt.Component; import java.awt.Rectangle; import java.awt.TextComponent; -import java.awt.event.KeyEvent; import java.awt.event.TextEvent; import java.awt.peer.TextComponentPeer; Index: gnu/java/awt/peer/gtk/GtkToolkit.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java,v retrieving revision 1.54.2.4 diff -u -3 -p -u -r1.54.2.4 GtkToolkit.java --- gnu/java/awt/peer/gtk/GtkToolkit.java 18 Jan 2005 11:38:29 -0000 1.54.2.4 +++ gnu/java/awt/peer/gtk/GtkToolkit.java 15 Feb 2005 20:55:12 -0000 @@ -51,7 +51,6 @@ import java.awt.datatransfer.Clipboard; import java.awt.dnd.DragGestureEvent; import java.awt.dnd.peer.DragSourceContextPeer; import java.awt.font.FontRenderContext; -import java.awt.font.TextAttribute; import java.awt.im.InputMethodHighlight; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; @@ -68,7 +67,6 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; -import java.util.MissingResourceException; import java.util.Properties; import javax.imageio.spi.IIORegistry; @@ -348,15 +346,18 @@ public class GtkToolkit extends gnu.java public FontMetrics getFontMetrics (Font font) { - if (metricsCache.containsKey(font)) - return (FontMetrics) metricsCache.get(font); - else + synchronized (metricsCache) + { + if (metricsCache.containsKey(font)) + return (FontMetrics) metricsCache.get(font); + } + + FontMetrics m = new GdkFontMetrics (font); + synchronized (metricsCache) { - FontMetrics m; - m = new GdkFontMetrics (font); metricsCache.put(font, m); - return m; - } + } + return m; } public Image getImage (String filename) @@ -632,11 +633,18 @@ public class GtkToolkit extends gnu.java throw new Error("not implemented"); } + public Rectangle getBounds() + { + int[] dims = new int[2]; + getScreenSizeDimensions(dims); + return new Rectangle(0, 0, dims[0], dims[1]); + } + // ClasspathToolkit methods public GraphicsEnvironment getLocalGraphicsEnvironment() { - return new GdkGraphicsEnvironment(); + return new GdkGraphicsEnvironment(this); } public Font createFont(int format, InputStream stream) Index: gnu/java/awt/peer/gtk/GtkWindowPeer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java,v retrieving revision 1.27.2.2 diff -u -3 -p -u -r1.27.2.2 GtkWindowPeer.java --- gnu/java/awt/peer/gtk/GtkWindowPeer.java 16 Jan 2005 15:15:01 -0000 1.27.2.2 +++ gnu/java/awt/peer/gtk/GtkWindowPeer.java 15 Feb 2005 20:55:12 -0000 @@ -39,7 +39,6 @@ exception statement from your version. * package gnu.java.awt.peer.gtk; import java.awt.Component; -import java.awt.Dimension; import java.awt.Frame; import java.awt.Window; import java.awt.event.WindowEvent; Index: gnu/java/io/EncodingManager.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/io/EncodingManager.java,v retrieving revision 1.7.2.3 diff -u -3 -p -u -r1.7.2.3 EncodingManager.java --- gnu/java/io/EncodingManager.java 16 Jan 2005 15:15:01 -0000 1.7.2.3 +++ gnu/java/io/EncodingManager.java 15 Feb 2005 20:55:12 -0000 @@ -46,7 +46,6 @@ import java.lang.reflect.Constructor; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; -import java.security.AccessController; import java.util.Hashtable; import java.util.StringTokenizer; Index: gnu/java/io/decode/DecoderUTF8.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/io/decode/DecoderUTF8.java,v retrieving revision 1.5.2.1 diff -u -3 -p -u -r1.5.2.1 DecoderUTF8.java --- gnu/java/io/decode/DecoderUTF8.java 16 Jan 2005 02:14:45 -0000 1.5.2.1 +++ gnu/java/io/decode/DecoderUTF8.java 15 Feb 2005 20:55:12 -0000 @@ -39,7 +39,6 @@ exception statement from your version. * package gnu.java.io.decode; import java.io.InputStream; -import java.io.CharConversionException; import java.io.IOException; /** Index: gnu/java/net/protocol/file/Connection.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/file/Connection.java,v retrieving revision 1.8.2.2 diff -u -3 -p -u -r1.8.2.2 Connection.java --- gnu/java/net/protocol/file/Connection.java 16 Jan 2005 15:15:08 -0000 1.8.2.2 +++ gnu/java/net/protocol/file/Connection.java 15 Feb 2005 20:55:12 -0000 @@ -53,7 +53,6 @@ import java.net.ProtocolException; import java.net.URL; import java.net.URLConnection; import java.security.Permission; -import java.security.AccessController; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; Index: gnu/java/net/protocol/ftp/ActiveModeDTP.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/ftp/ActiveModeDTP.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 ActiveModeDTP.java --- gnu/java/net/protocol/ftp/ActiveModeDTP.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/java/net/protocol/ftp/ActiveModeDTP.java 15 Feb 2005 20:55:12 -0000 @@ -42,7 +42,6 @@ import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; import java.net.InetAddress; -import java.net.InetSocketAddress; import java.net.ServerSocket; import java.net.Socket; Index: gnu/java/net/protocol/ftp/BlockInputStream.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/ftp/BlockInputStream.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 BlockInputStream.java --- gnu/java/net/protocol/ftp/BlockInputStream.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/java/net/protocol/ftp/BlockInputStream.java 15 Feb 2005 20:55:12 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.net.protocol.ftp; -import java.io.FilterInputStream; import java.io.InputStream; import java.io.IOException; Index: gnu/java/net/protocol/ftp/BlockOutputStream.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/ftp/BlockOutputStream.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 BlockOutputStream.java --- gnu/java/net/protocol/ftp/BlockOutputStream.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/java/net/protocol/ftp/BlockOutputStream.java 15 Feb 2005 20:55:12 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.net.protocol.ftp; -import java.io.FilterOutputStream; import java.io.IOException; import java.io.OutputStream; Index: gnu/java/net/protocol/ftp/CompressedOutputStream.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/ftp/CompressedOutputStream.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 CompressedOutputStream.java --- gnu/java/net/protocol/ftp/CompressedOutputStream.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/java/net/protocol/ftp/CompressedOutputStream.java 15 Feb 2005 20:55:12 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.net.protocol.ftp; -import java.io.FilterOutputStream; import java.io.IOException; import java.io.OutputStream; Index: gnu/java/net/protocol/ftp/StreamInputStream.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/ftp/StreamInputStream.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 StreamInputStream.java --- gnu/java/net/protocol/ftp/StreamInputStream.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/java/net/protocol/ftp/StreamInputStream.java 15 Feb 2005 20:55:12 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.net.protocol.ftp; -import java.io.FilterInputStream; import java.io.InputStream; import java.io.IOException; Index: gnu/java/net/protocol/ftp/StreamOutputStream.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/ftp/StreamOutputStream.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 StreamOutputStream.java --- gnu/java/net/protocol/ftp/StreamOutputStream.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/java/net/protocol/ftp/StreamOutputStream.java 15 Feb 2005 20:55:12 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.net.protocol.ftp; -import java.io.FilterOutputStream; import java.io.IOException; import java.io.OutputStream; Index: gnu/java/net/protocol/http/Cookie.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/http/Cookie.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 Cookie.java --- gnu/java/net/protocol/http/Cookie.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/java/net/protocol/http/Cookie.java 15 Feb 2005 20:55:12 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.net.protocol.http; -import java.text.ParseException; import java.util.Date; /** Index: gnu/java/net/protocol/http/HTTPConnection.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/http/HTTPConnection.java,v retrieving revision 1.4.2.1 diff -u -3 -p -u -r1.4.2.1 HTTPConnection.java --- gnu/java/net/protocol/http/HTTPConnection.java 16 Jan 2005 15:15:09 -0000 1.4.2.1 +++ gnu/java/net/protocol/http/HTTPConnection.java 15 Feb 2005 20:55:12 -0000 @@ -54,12 +54,10 @@ import java.net.InetSocketAddress; import java.net.Socket; import java.security.GeneralSecurityException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import javax.net.SocketFactory; import javax.net.ssl.HandshakeCompletedListener; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; Index: gnu/java/net/protocol/http/HTTPDateFormat.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/http/HTTPDateFormat.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 HTTPDateFormat.java --- gnu/java/net/protocol/http/HTTPDateFormat.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/java/net/protocol/http/HTTPDateFormat.java 15 Feb 2005 20:55:12 -0000 @@ -38,9 +38,15 @@ exception statement from your version. * package gnu.java.net.protocol.http; -import java.io.PrintStream; -import java.text.*; -import java.util.*; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.FieldPosition; +import java.text.NumberFormat; +import java.text.ParsePosition; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; /** * HTTP date formatter and parser. Index: gnu/java/net/protocol/http/Request.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/http/Request.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 Request.java --- gnu/java/net/protocol/http/Request.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/java/net/protocol/http/Request.java 15 Feb 2005 20:55:13 -0000 @@ -46,7 +46,6 @@ import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; import java.net.ProtocolException; -import java.net.Socket; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.DateFormat; Index: gnu/java/net/protocol/jar/Connection.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/jar/Connection.java,v retrieving revision 1.4.2.1 diff -u -3 -p -u -r1.4.2.1 Connection.java --- gnu/java/net/protocol/jar/Connection.java 3 Feb 2005 00:55:47 -0000 1.4.2.1 +++ gnu/java/net/protocol/jar/Connection.java 15 Feb 2005 20:55:13 -0000 @@ -97,9 +97,8 @@ public final class Connection extends Ja fos.close(); // Always verify the Manifest, open read only and delete when done. - // XXX ZipFile.OPEN_DELETE not yet implemented. - // jf = new JarFile (f, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); - jf = new JarFile (f, true, ZipFile.OPEN_READ); + jf = new JarFile (f, true, + ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); } cache.put (url, jf); Index: gnu/java/nio/SelectorImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/nio/SelectorImpl.java,v retrieving revision 1.16.2.1 diff -u -3 -p -u -r1.16.2.1 SelectorImpl.java --- gnu/java/nio/SelectorImpl.java 16 Jan 2005 15:15:09 -0000 1.16.2.1 +++ gnu/java/nio/SelectorImpl.java 15 Feb 2005 20:55:13 -0000 @@ -38,8 +38,6 @@ exception statement from your version. * package gnu.java.nio; -import gnu.classpath.Configuration; - import java.io.IOException; import java.nio.channels.ClosedSelectorException; import java.nio.channels.SelectableChannel; Index: gnu/java/rmi/dgc/DGCImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/rmi/dgc/DGCImpl.java,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 DGCImpl.java --- gnu/java/rmi/dgc/DGCImpl.java 31 Oct 2002 18:35:21 -0000 1.4 +++ gnu/java/rmi/dgc/DGCImpl.java 15 Feb 2005 20:55:13 -0000 @@ -42,7 +42,6 @@ import java.rmi.dgc.Lease; import java.rmi.dgc.VMID; import java.rmi.server.ObjID; import java.rmi.RemoteException; -import java.rmi.server.UnicastRemoteObject; import java.rmi.server.RMISocketFactory; import gnu.java.rmi.server.UnicastServerRef; Index: gnu/java/rmi/server/UnicastConnectionManager.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/rmi/server/UnicastConnectionManager.java,v retrieving revision 1.6.2.2 diff -u -3 -p -u -r1.6.2.2 UnicastConnectionManager.java --- gnu/java/rmi/server/UnicastConnectionManager.java 16 Jan 2005 02:14:45 -0000 1.6.2.2 +++ gnu/java/rmi/server/UnicastConnectionManager.java 15 Feb 2005 20:55:13 -0000 @@ -55,7 +55,6 @@ import java.rmi.server.RMIServerSocketFa import java.rmi.server.RMIClientSocketFactory; import java.util.ArrayList; import java.util.ConcurrentModificationException; -import java.util.Enumeration; import java.util.Hashtable; import java.util.Iterator; Index: gnu/java/security/pkcs/SignerInfo.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/pkcs/SignerInfo.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 SignerInfo.java --- gnu/java/security/pkcs/SignerInfo.java 16 Jan 2005 02:14:45 -0000 1.1.2.1 +++ gnu/java/security/pkcs/SignerInfo.java 15 Feb 2005 20:55:13 -0000 @@ -41,11 +41,9 @@ import gnu.java.security.ber.BER; import gnu.java.security.ber.BEREncodingException; import gnu.java.security.ber.BERReader; import gnu.java.security.ber.BERValue; -import gnu.java.security.der.BitString; import gnu.java.security.der.DERValue; import java.io.IOException; -import java.io.InputStream; import java.math.BigInteger; Index: gnu/java/security/provider/EncodedKeyFactory.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/provider/EncodedKeyFactory.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 EncodedKeyFactory.java --- gnu/java/security/provider/EncodedKeyFactory.java 16 Jan 2005 02:14:45 -0000 1.1.2.1 +++ gnu/java/security/provider/EncodedKeyFactory.java 15 Feb 2005 20:55:13 -0000 @@ -38,6 +38,11 @@ exception statement from your version. * package gnu.java.security.provider; +import gnu.java.security.OID; +import gnu.java.security.der.BitString; +import gnu.java.security.der.DERReader; +import gnu.java.security.der.DERValue; + import java.io.IOException; import java.math.BigInteger; @@ -45,15 +50,12 @@ import java.math.BigInteger; import java.security.AlgorithmParameters; import java.security.InvalidKeyException; import java.security.Key; -import java.security.KeyFactory; import java.security.KeyFactorySpi; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.PublicKey; import java.security.spec.DSAParameterSpec; -import java.security.spec.DSAPrivateKeySpec; -import java.security.spec.DSAPublicKeySpec; import java.security.spec.InvalidParameterSpecException; import java.security.spec.InvalidKeySpecException; import java.security.spec.KeySpec; @@ -64,12 +66,6 @@ import java.security.spec.X509EncodedKey import javax.crypto.spec.DHParameterSpec; -import gnu.java.security.OID; -import gnu.java.security.der.BitString; -import gnu.java.security.der.DER; -import gnu.java.security.der.DERReader; -import gnu.java.security.der.DERValue; - /** * A factory for keys encoded in either the X.509 format (for public * keys) or the PKCS#8 format (for private keys). Index: gnu/java/security/provider/GnuDHPublicKey.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/provider/GnuDHPublicKey.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 GnuDHPublicKey.java --- gnu/java/security/provider/GnuDHPublicKey.java 16 Jan 2005 02:14:45 -0000 1.1.2.1 +++ gnu/java/security/provider/GnuDHPublicKey.java 15 Feb 2005 20:55:13 -0000 @@ -49,7 +49,6 @@ import gnu.java.security.OID; import gnu.java.security.der.BitString; import gnu.java.security.der.DER; import gnu.java.security.der.DERValue; -import gnu.java.security.der.DERWriter; public class GnuDHPublicKey implements DHPublicKey { Index: gnu/java/security/provider/PKIXCertPathValidatorImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/provider/PKIXCertPathValidatorImpl.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 PKIXCertPathValidatorImpl.java --- gnu/java/security/provider/PKIXCertPathValidatorImpl.java 16 Jan 2005 02:14:45 -0000 1.1.2.1 +++ gnu/java/security/provider/PKIXCertPathValidatorImpl.java 15 Feb 2005 20:55:13 -0000 @@ -38,18 +38,40 @@ exception statement from your version. * package gnu.java.security.provider; +import gnu.java.security.OID; +import gnu.java.security.x509.GnuPKIExtension; +import gnu.java.security.x509.PolicyNodeImpl; +import gnu.java.security.x509.X509CertSelectorImpl; +import gnu.java.security.x509.X509CRLSelectorImpl; +import gnu.java.security.x509.ext.BasicConstraints; +import gnu.java.security.x509.ext.CertificatePolicies; +import gnu.java.security.x509.ext.Extension; +import gnu.java.security.x509.ext.KeyUsage; +import gnu.java.security.x509.ext.PolicyConstraint; + import java.io.IOException; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; -import java.security.Principal; import java.security.PublicKey; -import java.security.cert.*; - +import java.security.cert.CertificateException; +import java.security.cert.CertPath; +import java.security.cert.CertPathParameters; +import java.security.cert.CertPathValidatorException; +import java.security.cert.CertPathValidatorResult; +import java.security.cert.CertPathValidatorSpi; +import java.security.cert.CertStore; +import java.security.cert.CertStoreException; +import java.security.cert.CRL; +import java.security.cert.PKIXCertPathChecker; +import java.security.cert.PKIXCertPathValidatorResult; +import java.security.cert.PKIXParameters; +import java.security.cert.TrustAnchor; +import java.security.cert.X509Certificate; +import java.security.cert.X509CRL; import java.security.interfaces.DSAParams; import java.security.interfaces.DSAPublicKey; -import java.security.spec.DSAParameterSpec; import java.util.Arrays; import java.util.Collection; @@ -61,13 +83,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; -import gnu.java.security.x509.GnuPKIExtension; -import gnu.java.security.x509.PolicyNodeImpl; -import gnu.java.security.x509.X509CertSelectorImpl; -import gnu.java.security.x509.X509CRLSelectorImpl; -import gnu.java.security.x509.ext.*; -import gnu.java.security.OID; - /** * An implementation of the Public Key Infrastructure's X.509 * certificate path validation algorithm. Index: gnu/java/security/x509/X500DistinguishedName.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/x509/X500DistinguishedName.java,v retrieving revision 1.1.2.2 diff -u -3 -p -u -r1.1.2.2 X500DistinguishedName.java --- gnu/java/security/x509/X500DistinguishedName.java 16 Jan 2005 02:14:46 -0000 1.1.2.2 +++ gnu/java/security/x509/X500DistinguishedName.java 15 Feb 2005 20:55:13 -0000 @@ -55,7 +55,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.TreeMap; import gnu.java.security.der.DER; import gnu.java.security.der.DERReader; Index: gnu/java/security/x509/X509CRL.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/x509/X509CRL.java,v retrieving revision 1.1.2.2 diff -u -3 -p -u -r1.1.2.2 X509CRL.java --- gnu/java/security/x509/X509CRL.java 16 Jan 2005 02:14:46 -0000 1.1.2.2 +++ gnu/java/security/x509/X509CRL.java 15 Feb 2005 20:55:13 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.security.x509; -import gnu.java.io.ASN1ParsingException; import gnu.java.security.OID; import gnu.java.security.der.BitString; import gnu.java.security.der.DER; Index: gnu/java/security/x509/X509CRLEntry.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/x509/X509CRLEntry.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 X509CRLEntry.java --- gnu/java/security/x509/X509CRLEntry.java 16 Jan 2005 02:14:46 -0000 1.1.2.1 +++ gnu/java/security/x509/X509CRLEntry.java 15 Feb 2005 20:55:13 -0000 @@ -38,7 +38,6 @@ exception statement from your version. * package gnu.java.security.x509; -import java.io.InputStream; import java.io.IOException; import java.math.BigInteger; Index: gnu/java/security/x509/X509Certificate.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/x509/X509Certificate.java,v retrieving revision 1.3.2.2 diff -u -3 -p -u -r1.3.2.2 X509Certificate.java --- gnu/java/security/x509/X509Certificate.java 16 Jan 2005 15:15:09 -0000 1.3.2.2 +++ gnu/java/security/x509/X509Certificate.java 15 Feb 2005 20:55:15 -0000 @@ -38,18 +38,14 @@ exception statement from your version. * package gnu.java.security.x509; -import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.IOException; -import java.io.ObjectStreamException; import java.io.PrintWriter; import java.io.Serializable; import java.io.StringWriter; import java.math.BigInteger; -import java.net.InetAddress; - import java.security.AlgorithmParameters; import java.security.InvalidKeyException; import java.security.KeyFactory; @@ -79,7 +75,6 @@ import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; Index: gnu/java/security/x509/ext/AuthorityKeyIdentifier.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/x509/ext/AuthorityKeyIdentifier.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 AuthorityKeyIdentifier.java --- gnu/java/security/x509/ext/AuthorityKeyIdentifier.java 16 Jan 2005 02:14:46 -0000 1.1.2.1 +++ gnu/java/security/x509/ext/AuthorityKeyIdentifier.java 15 Feb 2005 20:55:15 -0000 @@ -40,7 +40,6 @@ package gnu.java.security.x509.ext; import java.io.IOException; import java.math.BigInteger; -import java.util.List; import gnu.java.security.OID; import gnu.java.security.der.DER; Index: gnu/java/security/x509/ext/CertificatePolicies.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/x509/ext/CertificatePolicies.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 CertificatePolicies.java --- gnu/java/security/x509/ext/CertificatePolicies.java 16 Jan 2005 02:14:46 -0000 1.1.2.1 +++ gnu/java/security/x509/ext/CertificatePolicies.java 15 Feb 2005 20:55:15 -0000 @@ -39,7 +39,6 @@ exception statement from your version. * package gnu.java.security.x509.ext; import java.io.IOException; -import java.math.BigInteger; import java.security.cert.PolicyQualifierInfo; import java.util.ArrayList; Index: gnu/java/security/x509/ext/PolicyConstraint.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/x509/ext/PolicyConstraint.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 PolicyConstraint.java --- gnu/java/security/x509/ext/PolicyConstraint.java 16 Jan 2005 02:14:46 -0000 1.1.2.1 +++ gnu/java/security/x509/ext/PolicyConstraint.java 15 Feb 2005 20:55:15 -0000 @@ -42,10 +42,8 @@ import java.io.IOException; import java.math.BigInteger; import gnu.java.security.OID; -import gnu.java.security.der.DER; import gnu.java.security.der.DERReader; import gnu.java.security.der.DERValue; -import gnu.java.security.x509.Util; public class PolicyConstraint extends Extension.Value { Index: gnu/xml/aelfred2/SAXDriver.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/aelfred2/SAXDriver.java,v retrieving revision 1.1.2.2 diff -u -3 -p -u -r1.1.2.2 SAXDriver.java --- gnu/xml/aelfred2/SAXDriver.java 6 Feb 2005 02:24:18 -0000 1.1.2.2 +++ gnu/xml/aelfred2/SAXDriver.java 15 Feb 2005 20:55:15 -0000 @@ -65,10 +65,8 @@ import java.util.Stack; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; -import java.util.Hashtable; import java.util.Iterator; import java.util.List; -import java.util.Vector; import org.xml.sax.*; import org.xml.sax.ext.*; @@ -1031,7 +1029,7 @@ final public class SAXDriver */ public int getLength () { - return attributesList.size (); + return attributesList.size(); } /** @@ -1039,7 +1037,11 @@ final public class SAXDriver */ public String getURI (int index) { - return ((Attribute) attributesList.get (index)).nameSpace; + if (index < 0 || index >= attributesList.size()) + { + return null; + } + return ((Attribute) attributesList.get(index)).nameSpace; } /** @@ -1047,7 +1049,11 @@ final public class SAXDriver */ public String getLocalName (int index) { - Attribute attr = (Attribute) attributesList.get (index); + if (index < 0 || index >= attributesList.size()) + { + return null; + } + Attribute attr = (Attribute) attributesList.get(index); // FIXME attr.localName is sometimes null, why? if (namespaces && attr.localName == null) { @@ -1056,38 +1062,51 @@ final public class SAXDriver attr.localName = (ci == -1) ? attr.name : attr.name.substring(ci + 1); } - return attr.localName; + return (attr.localName == null) ? "" : attr.localName; } /** * SAX2 Attributes method (don't invoke on parser); */ - public String getQName (int i) + public String getQName (int index) { - return ((Attribute) attributesList.get (i)).name; + if (index < 0 || index >= attributesList.size()) + { + return null; + } + Attribute attr = (Attribute) attributesList.get(index); + return (attr.name == null) ? "" : attr.name; } /** * SAX1 AttributeList method (don't invoke on parser); */ - public String getName (int i) + public String getName (int index) { - return ((Attribute) attributesList.get (i)).name; + return getQName(index); } /** * SAX1 AttributeList, SAX2 Attributes method * (don't invoke on parser); */ - public String getType (int i) + public String getType (int index) { - String type = parser.getAttributeType (elementName, getQName (i)); + if (index < 0 || index >= attributesList.size()) + { + return null; + } + String type = parser.getAttributeType(elementName, getQName(index)); if (type == null) + { return "CDATA"; + } // ... use DeclHandler.attributeDecl to see enumerations - if (type == "ENUMERATION") - return "NMTOKEN"; - return type; + if (type == "ENUMERATION") + { + return "NMTOKEN"; + } + return type; } @@ -1095,9 +1114,13 @@ final public class SAXDriver * SAX1 AttributeList, SAX2 Attributes method * (don't invoke on parser); */ - public String getValue (int i) + public String getValue (int index) { - return ((Attribute) attributesList.get (i)).value; + if (index < 0 || index >= attributesList.size()) + { + return null; + } + return ((Attribute) attributesList.get(index)).value; } @@ -1106,14 +1129,19 @@ final public class SAXDriver */ public int getIndex (String uri, String local) { - int length = getLength (); + int length = getLength(); - for (int i = 0; i < length; i++) { - if (!getURI (i).equals (uri)) + for (int i = 0; i < length; i++) + { + if (!getURI(i).equals(uri)) + { continue; - if (getLocalName (i).equals (local)) + } + if (getLocalName(i).equals(local)) + { return i; - } + } + } return -1; } @@ -1123,12 +1151,15 @@ final public class SAXDriver */ public int getIndex (String xmlName) { - int length = getLength (); + int length = getLength(); - for (int i = 0; i < length; i++) { - if (getQName (i).equals (xmlName)) + for (int i = 0; i < length; i++) + { + if (getQName(i).equals(xmlName)) + { return i; - } + } + } return -1; } @@ -1138,11 +1169,13 @@ final public class SAXDriver */ public String getType (String uri, String local) { - int index = getIndex (uri, local); + int index = getIndex(uri, local); if (index < 0) + { return null; - return getType (index); + } + return getType(index); } @@ -1152,11 +1185,13 @@ final public class SAXDriver */ public String getType (String xmlName) { - int index = getIndex (xmlName); + int index = getIndex(xmlName); if (index < 0) + { return null; - return getType (index); + } + return getType(index); } @@ -1165,11 +1200,13 @@ final public class SAXDriver */ public String getValue (String uri, String local) { - int index = getIndex (uri, local); + int index = getIndex(uri, local); if (index < 0) + { return null; - return getValue (index); + } + return getValue(index); } @@ -1179,11 +1216,13 @@ final public class SAXDriver */ public String getValue (String xmlName) { - int index = getIndex (xmlName); + int index = getIndex(xmlName); if (index < 0) + { return null; - return getValue (index); + } + return getValue(index); } Index: gnu/xml/dom/Consumer.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/Consumer.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 Consumer.java --- gnu/xml/dom/Consumer.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/Consumer.java 15 Feb 2005 20:55:15 -0000 @@ -38,16 +38,11 @@ exception statement from your version. * package gnu.xml.dom; -import java.io.IOException; - -import org.w3c.dom.Document; import org.w3c.dom.DocumentType; -import org.w3c.dom.DOMImplementation; import org.w3c.dom.Node; import org.w3c.dom.Text; import org.xml.sax.Attributes; -import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.ext.Attributes2; Index: gnu/xml/dom/DomAttr.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomAttr.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomAttr.java --- gnu/xml/dom/DomAttr.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/DomAttr.java 15 Feb 2005 20:55:15 -0000 @@ -38,6 +38,7 @@ exception statement from your version. * package gnu.xml.dom; import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.TypeInfo; @@ -194,7 +195,7 @@ public class DomAttr { if (readonly) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (value == null) { @@ -284,11 +285,11 @@ public class DomAttr { if (parent != null) { - throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR); + throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR); } if (!(e instanceof DomElement)) { - throw new DomEx(DomEx.WRONG_DOCUMENT_ERR); + throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR); } parent = (DomElement) e; depth = parent.depth + 1; Index: gnu/xml/dom/DomCDATA.java =================================================================== RCS file: gnu/xml/dom/DomCDATA.java diff -N gnu/xml/dom/DomCDATA.java --- gnu/xml/dom/DomCDATA.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,91 +0,0 @@ -/* DomCDATA.java -- - Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package gnu.xml.dom; - -import org.w3c.dom.CDATASection; - -/** - *"CDATASection" implementation. - * This is a non-core DOM class, supporting the "XML" feature. - * CDATA sections are just ways to represent text using different - * delimeters.
- * - *You are strongly advised not to use CDATASection nodes. - * The advantage of having slightly prettier ways to print text that may - * have lots of embedded XML delimiters, such as "&" and "<", - * can be dwarfed by the cost of dealing with multiple kinds of text - * nodes in all your algorithms.
- * - * @author David Brownell - * @author Chris Burdess - */ -public class DomCDATA - extends DomText - implements CDATASection -{ - - /** - * Constructs a CDATA section node associated with the specified - * document and holding the specified data. - * - *This constructor should only be invoked by a Document as part of - * its createCDATASection functionality, or through a subclass which is - * similarly used in a "Sub-DOM" style layer. - * - */ - protected DomCDATA(DomDocument owner, String value) - { - super(CDATA_SECTION_NODE, owner, value); - } - - protected DomCDATA(DomDocument owner, char buf [], int off, int len) - { - super(CDATA_SECTION_NODE, owner, buf, off, len); - } - - /** - * DOM L1 - * Returns the string "#cdata-section". - */ - final public String getNodeName() - { - return "#cdata-section"; - } - -} - Index: gnu/xml/dom/DomCDATASection.java =================================================================== RCS file: gnu/xml/dom/DomCDATASection.java diff -N gnu/xml/dom/DomCDATASection.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/xml/dom/DomCDATASection.java 15 Feb 2005 20:55:15 -0000 @@ -0,0 +1,91 @@ +/* DomCDATASection.java -- + Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.xml.dom; + +import org.w3c.dom.CDATASection; + +/** + *
"CDATASection" implementation. + * This is a non-core DOM class, supporting the "XML" feature. + * CDATA sections are just ways to represent text using different + * delimeters.
+ * + *You are strongly advised not to use CDATASection nodes. + * The advantage of having slightly prettier ways to print text that may + * have lots of embedded XML delimiters, such as "&" and "<", + * can be dwarfed by the cost of dealing with multiple kinds of text + * nodes in all your algorithms.
+ * + * @author David Brownell + * @author Chris Burdess + */ +public class DomCDATASection + extends DomText + implements CDATASection +{ + + /** + * Constructs a CDATA section node associated with the specified + * document and holding the specified data. + * + *This constructor should only be invoked by a Document as part of + * its createCDATASection functionality, or through a subclass which is + * similarly used in a "Sub-DOM" style layer. + * + */ + protected DomCDATASection(DomDocument owner, String value) + { + super(CDATA_SECTION_NODE, owner, value); + } + + protected DomCDATASection(DomDocument owner, char buf [], int off, int len) + { + super(CDATA_SECTION_NODE, owner, buf, off, len); + } + + /** + * DOM L1 + * Returns the string "#cdata-section". + */ + final public String getNodeName() + { + return "#cdata-section"; + } + +} + Index: gnu/xml/dom/DomCharacterData.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomCharacterData.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomCharacterData.java --- gnu/xml/dom/DomCharacterData.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/DomCharacterData.java 15 Feb 2005 20:55:15 -0000 @@ -38,8 +38,7 @@ exception statement from your version. * package gnu.xml.dom; import org.w3c.dom.CharacterData; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; +import org.w3c.dom.DOMException; import org.w3c.dom.events.MutationEvent; @@ -82,7 +81,7 @@ public abstract class DomCharacterData { if (isReadonly()) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } String value = text + arg; mutating(value); @@ -98,12 +97,12 @@ public abstract class DomCharacterData { if (isReadonly()) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } char[] raw = text.toCharArray(); if (offset < 0 || count < 0 || offset > raw.length) { - throw new DomEx(DomEx.INDEX_SIZE_ERR); + throw new DomDOMException(DOMException.INDEX_SIZE_ERR); } if ((offset + count) > raw.length) { @@ -125,7 +124,7 @@ public abstract class DomCharacterData } catch (IndexOutOfBoundsException x) { - throw new DomEx(DomEx.INDEX_SIZE_ERR); + throw new DomDOMException(DOMException.INDEX_SIZE_ERR); } } @@ -164,7 +163,7 @@ public abstract class DomCharacterData { if (isReadonly()) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } char[] raw = text.toCharArray(); char[] tmp = arg.toCharArray (); @@ -182,7 +181,7 @@ public abstract class DomCharacterData } catch (IndexOutOfBoundsException x) { - throw new DomEx(DomEx.INDEX_SIZE_ERR); + throw new DomDOMException(DOMException.INDEX_SIZE_ERR); } } @@ -195,14 +194,14 @@ public abstract class DomCharacterData { if (readonly) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } char[] raw = text.toCharArray(); // deleteData if (offset < 0 || count < 0 || offset > raw.length) { - throw new DomEx(DomEx.INDEX_SIZE_ERR); + throw new DomDOMException(DOMException.INDEX_SIZE_ERR); } if ((offset + count) > raw.length) { @@ -228,7 +227,7 @@ public abstract class DomCharacterData } catch (IndexOutOfBoundsException x) { - throw new DomEx(DomEx.INDEX_SIZE_ERR); + throw new DomDOMException(DOMException.INDEX_SIZE_ERR); } } @@ -241,7 +240,7 @@ public abstract class DomCharacterData { if (isReadonly()) { - throw new DomEx (DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (value == null) { @@ -276,7 +275,7 @@ public abstract class DomCharacterData { return text.substring(offset); } - throw new DomEx(DomEx.INDEX_SIZE_ERR); + throw new DomDOMException(DOMException.INDEX_SIZE_ERR); } } Index: gnu/xml/dom/DomDOMException.java =================================================================== RCS file: gnu/xml/dom/DomDOMException.java diff -N gnu/xml/dom/DomDOMException.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/xml/dom/DomDOMException.java 15 Feb 2005 20:55:15 -0000 @@ -0,0 +1,175 @@ +/* DomDOMException.java -- + Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.xml.dom; + +import org.w3c.dom.DOMException; +import org.w3c.dom.Node; + +/** + *
DOMException implementation. The version that + * is provided by the W3C is abstract, so it can't be instantiated. + * + *
This also provides a bit more information about the error + * that is being reported, in terms of the relevant DOM structures + * and data. + * + * @author David Brownell + */ +public class DomDOMException + extends DOMException +{ + + /** @serial Data that caused an error to be reported */ + private String data; + + /** @serial Node associated with the error. */ + private Node node; + + /** @serial Data associated with the error. */ + private int value; + + /** + * Constructs an exception, with the diagnostic message + * corresponding to the specified code. + */ + public DomDOMException(short code) + { + super(code, diagnostic(code)); + } + + /** + * Constructs an exception, with the diagnostic message + * corresponding to the specified code and additional + * information as provided. + */ + public DomDOMException(short code, String data, Node node, int value) + { + super(code, diagnostic(code)); + this.data = data; + this.node = node; + this.value = value; + } + + /** Returns the node to which the diagnotic applies, or null. */ + final public Node getNode() + { + return node; + } + + /** Returns data to which the diagnotic applies, or null. */ + final public String getData() + { + return data; + } + + /** Returns data to which the diagnotic applies, or null. */ + final public int getValue() + { + return value; + } + + /** + * Returns a diagnostic message that may be slightly more useful + * than the generic one, where possible. + */ + public String getMessage() + { + String retval = super.getMessage(); + + if (data != null) + { + retval += "\nMore Information: " + data; + } + if (value != 0) + { + retval += "\nNumber: " + value; + } + if (node != null) + { + retval += "\nNode Name: " + node.getNodeName(); + } + return retval; + } + + // these strings should be localizable. + + private static String diagnostic(short code) + { + switch (code) + { + // DOM L1: + case INDEX_SIZE_ERR: + return "An index or size is out of range."; + case DOMSTRING_SIZE_ERR: + return "A string is too big."; + case HIERARCHY_REQUEST_ERR: + return "The node doesn't belong here."; + case WRONG_DOCUMENT_ERR: + return "The node belongs in another document."; + case INVALID_CHARACTER_ERR: + return "That character is not permitted."; + case NO_DATA_ALLOWED_ERR: + return "This node does not permit data."; + case NO_MODIFICATION_ALLOWED_ERR: + return "No changes are allowed."; + case NOT_FOUND_ERR: + return "The node was not found in that context."; + case NOT_SUPPORTED_ERR: + return "That object is not supported."; + case INUSE_ATTRIBUTE_ERR: + return "The attribute belongs to a different element."; + + // DOM L2: + case INVALID_STATE_ERR: + return "The object is not usable."; + case SYNTAX_ERR: + return "An illegal string was provided."; + case INVALID_MODIFICATION_ERR: + return "An object's type may not be changed."; + case NAMESPACE_ERR: + return "The operation violates XML Namespaces."; + case INVALID_ACCESS_ERR: + return "Parameter or operation isn't supported by this node."; + case TYPE_MISMATCH_ERR: + return "The type of the argument is incompatible with the expected type."; + } + return "Reserved exception number: " + code; + } + +} + Index: gnu/xml/dom/DomDoctype.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomDoctype.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomDoctype.java --- gnu/xml/dom/DomDoctype.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/DomDoctype.java 15 Feb 2005 20:55:15 -0000 @@ -39,6 +39,7 @@ package gnu.xml.dom; import java.util.HashMap; import org.w3c.dom.DocumentType; +import org.w3c.dom.DOMException; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Entity; import org.w3c.dom.NamedNodeMap; @@ -194,7 +195,7 @@ public class DomDoctype } if (isReadonly()) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } getEntities(); @@ -250,7 +251,7 @@ public class DomDoctype if (isReadonly()) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } getNotations(); Index: gnu/xml/dom/DomDocument.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomDocument.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomDocument.java --- gnu/xml/dom/DomDocument.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/DomDocument.java 15 Feb 2005 20:55:15 -0000 @@ -54,7 +54,6 @@ import org.w3c.dom.Entity; import org.w3c.dom.EntityReference; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import org.w3c.dom.Notation; import org.w3c.dom.ProcessingInstruction; import org.w3c.dom.Text; @@ -292,16 +291,16 @@ public class DomDocument if (newChild.getNodeType() == ELEMENT_NODE && getDocumentElement() != null) { - throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR, - "document element already present: " + - getDocumentElement(), newChild, 0); + throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, + "document element already present: " + + getDocumentElement(), newChild, 0); } if (newChild.getNodeType() == DOCUMENT_TYPE_NODE && getDoctype() != null) { - throw new DomEx (DomEx.HIERARCHY_REQUEST_ERR, - "document type already present: " + - getDoctype(), newChild, 0); + throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, + "document type already present: " + + getDoctype(), newChild, 0); } } @@ -376,12 +375,12 @@ public class DomDocument { if (name == null) { - throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0); } int len = name.length(); if (len == 0) { - throw new DomEx (DomEx.NAMESPACE_ERR, name, null, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0); } // dog: rewritten to use the rules for XML 1.0 and 1.1 @@ -407,7 +406,8 @@ public class DomDocument (c < 0xfdf0 || c > 0xfffd) && (c < 0x10000 || c > 0xeffff)) { - throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); + throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, + name, null, c); } } else @@ -425,14 +425,16 @@ public class DomDocument (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions - throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); + throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, + name, null, c); } break; default: if (c != ':' && c != '_' && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6) { - throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); + throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, + name, null, c); } } } @@ -464,7 +466,8 @@ public class DomDocument (c < 0x0300 || c > 0x036f) && (c < 0x203f || c > 0x2040)) { - throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); + throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, name, + null, c); } } else @@ -487,7 +490,8 @@ public class DomDocument (c >= 0x20dd && c <= 0x20e0)) { // Compatibility area and Unicode 2.0 exclusions - throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); + throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, + name, null, c); } break; default: @@ -495,7 +499,8 @@ public class DomDocument c != 0x0387 && (c < 0x02bb || c > 0x02c1) && c != 0x0559 && c != 0x06e5 && c != 0x06e6 && c != 0x00b7) { - throw new DomEx(DomEx.INVALID_CHARACTER_ERR, name, null, c); + throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, + name, null, c); } } } @@ -517,7 +522,8 @@ public class DomDocument if (index == 0 || index == (len - 1) || name.lastIndexOf(':') != index) { - throw new DomEx(DomEx.NAMESPACE_ERR, name, null, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + name, null, 0); } } } @@ -552,8 +558,8 @@ public class DomDocument continue; } } - throw new DomEx(DomEx.INVALID_CHARACTER_ERR, - new String(buf, off, len), null, c); + throw new DomDOMException(DOMException.INVALID_CHARACTER_ERR, + new String(buf, off, len), null, c); } } @@ -602,22 +608,23 @@ public class DomDocument if (namespaceURI != null && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "xml namespace is always " + - XMLConstants.XML_NS_URI, this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "xml namespace is always " + + XMLConstants.XML_NS_URI, this, 0); } namespaceURI = XMLConstants.XML_NS_URI; } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:")) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "xmlns is reserved", this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "xmlns is reserved", this, 0); } else if (namespaceURI == null && name.indexOf(':') != -1) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "prefixed name '" + name + "' needs a URI", this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "prefixed name '" + name + + "' needs a URI", this, 0); } Element element = new DomElement(this, namespaceURI, name); @@ -660,7 +667,7 @@ public class DomDocument */ public DocumentFragment createDocumentFragment() { - return new DomFragment(this); + return new DomDocumentFragment(this); } /** @@ -711,7 +718,7 @@ public class DomDocument { checkChar(value, "1.1".equals(version)); } - return new DomCDATA(this, value); + return new DomCDATASection(this, value); } /** @@ -723,7 +730,7 @@ public class DomDocument { checkChar(buf, off, len, "1.1".equals(version)); } - return new DomCDATA(this, buf, off, len); + return new DomCDATASection(this, buf, off, len); } /** @@ -739,12 +746,13 @@ public class DomDocument checkName(target, xml11); if ("xml".equalsIgnoreCase(target)) { - throw new DomEx(DomEx.SYNTAX_ERR, - "illegal PI target name", this, 0); + throw new DomDOMException(DOMException.SYNTAX_ERR, + "illegal PI target name", + this, 0); } checkChar(data, xml11); } - return new DomPI(this, target, data); + return new DomProcessingInstruction(this, target, data); } /** @@ -796,9 +804,10 @@ public class DomDocument } else if (!XMLConstants.XML_NS_URI.equals(namespaceURI)) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "xml namespace is always " + - XMLConstants.XML_NS_URI, this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "xml namespace is always " + + XMLConstants.XML_NS_URI, + this, 0); } } else if (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || @@ -810,14 +819,15 @@ public class DomDocument } else if (!XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "xmlns namespace must be " + - XMLConstants.XMLNS_ATTRIBUTE_NS_URI, this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "xmlns namespace must be " + + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, + this, 0); } } else if (namespaceURI == null && name.indexOf(':') != -1) { - throw new DomEx(DomEx.NAMESPACE_ERR, + throw new DomDOMException(DOMException.NAMESPACE_ERR, "prefixed name needs a URI: " + name, this, 0); } return new DomAttr(this, namespaceURI, name); @@ -913,7 +923,7 @@ public class DomDocument dst = createEntityReference(src.getNodeName()); break; case DOCUMENT_FRAGMENT_NODE: - dst = new DomFragment(this); + dst = new DomDocumentFragment(this); if (deep) { for (Node ctx = src.getFirstChild(); ctx != null; @@ -988,7 +998,7 @@ public class DomDocument // FALLTHROUGH // can't import unrecognized or nonstandard nodes default: - throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, src, 0); + throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, src, 0); } // FIXME cleanup a bit -- for deep copies, copy those @@ -1083,7 +1093,7 @@ public class DomDocument } else { - throw new DomEx(DomEx.NOT_SUPPORTED_ERR); + throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); } } @@ -1149,10 +1159,10 @@ public class DomDocument { case DOCUMENT_NODE: case DOCUMENT_TYPE_NODE: - throw new DomEx(DomEx.NOT_SUPPORTED_ERR); + throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR); case ENTITY_NODE: case NOTATION_NODE: - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (source instanceof DomNode) { @@ -1284,11 +1294,12 @@ public class DomDocument DomNsNode src = (DomNsNode) n; if (src == null) { - throw new DomEx(DomEx.NOT_FOUND_ERR); + throw new DomDOMException(DOMException.NOT_FOUND_ERR); } if (src.owner != this) { - throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0); + throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, + null, src, 0); } boolean xml11 = "1.1".equals(version); checkName(qualifiedName, xml11); @@ -1305,7 +1316,7 @@ public class DomDocument if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespaceURI)) { - throw new DomEx(DomEx.NAMESPACE_ERR, + throw new DomDOMException(DOMException.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } @@ -1314,14 +1325,14 @@ public class DomDocument XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI)) { - throw new DomEx(DomEx.NAMESPACE_ERR, + throw new DomDOMException(DOMException.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } if (XMLConstants.XML_NS_URI.equals(namespaceURI) && !XMLConstants.XML_NS_PREFIX.equals(prefix)) { - throw new DomEx(DomEx.NAMESPACE_ERR, + throw new DomDOMException(DOMException.NAMESPACE_ERR, "xml namespace must be " + XMLConstants.XML_NS_URI, src, 0); } @@ -1330,7 +1341,7 @@ public class DomDocument !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) || XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName))) { - throw new DomEx(DomEx.NAMESPACE_ERR, + throw new DomDOMException(DOMException.NAMESPACE_ERR, "xmlns namespace must be " + XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0); } @@ -1343,7 +1354,7 @@ public class DomDocument // DOMElementNameChanged or DOMAttributeNameChanged return src; } - throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0); + throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, null, n, 0); } // -- XPathEvaluator -- Index: gnu/xml/dom/DomDocumentBuilder.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomDocumentBuilder.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomDocumentBuilder.java --- gnu/xml/dom/DomDocumentBuilder.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/DomDocumentBuilder.java 15 Feb 2005 20:55:15 -0000 @@ -40,7 +40,6 @@ package gnu.xml.dom; import java.io.InputStream; import java.io.IOException; import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.DOMConfiguration; import org.w3c.dom.DOMImplementation; Index: gnu/xml/dom/DomDocumentConfiguration.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomDocumentConfiguration.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomDocumentConfiguration.java --- gnu/xml/dom/DomDocumentConfiguration.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/DomDocumentConfiguration.java 15 Feb 2005 20:55:15 -0000 @@ -99,8 +99,8 @@ class DomDocumentConfiguration } catch (ClassCastException e) { - throw new DomEx(DomEx.TYPE_MISMATCH_ERR, - value.getClass().getName(), null, 0); + throw new DomDOMException(DOMException.TYPE_MISMATCH_ERR, + value.getClass().getName(), null, 0); } } else if ("namespace-declarations".equals(name)) @@ -140,7 +140,8 @@ class DomDocumentConfiguration } else { - throw new DomEx(DomEx.NOT_SUPPORTED_ERR, name, null, 0); + throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, + name, null, 0); } } @@ -197,7 +198,7 @@ class DomDocumentConfiguration namespaceDeclarations == true && comments == true) ? Boolean.TRUE : Boolean.FALSE; } - throw new DomEx(DomEx.NOT_SUPPORTED_ERR, name, null, 0); + throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, name, null, 0); } public boolean canSetParameter(String name, Object value) Index: gnu/xml/dom/DomDocumentFragment.java =================================================================== RCS file: gnu/xml/dom/DomDocumentFragment.java diff -N gnu/xml/dom/DomDocumentFragment.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/xml/dom/DomDocumentFragment.java 15 Feb 2005 20:55:15 -0000 @@ -0,0 +1,76 @@ +/* DomDocumentFragment.java -- + Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.xml.dom; + +import org.w3c.dom.DocumentFragment; + +/** + *
"DocumentFragment" implementation.
+ * + * @author David Brownell + * @author Chris Burdess + */ +public class DomDocumentFragment + extends DomNode + implements DocumentFragment +{ + + /** + * Constructs a DocumentFragment node associated with the + * specified document. + * + *This constructor should only be invoked by a Document as part of + * its createDocumentFragment functionality, or through a subclass which + * is similarly used in a "Sub-DOM" style layer. + */ + protected DomDocumentFragment(DomDocument owner) + { + super(DOCUMENT_FRAGMENT_NODE, owner); + } + + /** + * DOM L1 + * Returns the string "#document-fragment". + */ + final public String getNodeName() + { + return "#document-fragment"; + } + +} + Index: gnu/xml/dom/DomElement.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomElement.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomElement.java --- gnu/xml/dom/DomElement.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/DomElement.java 15 Feb 2005 20:55:15 -0000 @@ -42,6 +42,7 @@ import java.util.Set; import javax.xml.XMLConstants; import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -262,7 +263,7 @@ public class DomElement if (("xmlns".equals (aname) || aname.startsWith ("xmlns:")) && !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals (uri)) { - throw new DomEx(DomEx.NAMESPACE_ERR, + throw new DomDOMException(DOMException.NAMESPACE_ERR, "setting xmlns attribute to illegal value", this, 0); } @@ -318,9 +319,9 @@ public class DomElement { attributes.removeNamedItem(name); } - catch (DomEx e) + catch (DomDOMException e) { - if (e.code != DomEx.NOT_FOUND_ERR) + if (e.code != DOMException.NOT_FOUND_ERR) { throw e; } @@ -340,7 +341,7 @@ public class DomElement { if (attributes == null) { - throw new DomEx(DomEx.NOT_FOUND_ERR, null, node, 0); + throw new DomDOMException(DOMException.NOT_FOUND_ERR, null, node, 0); } return (Attr) attributes.removeNamedItem(node.getNodeName()); } @@ -358,7 +359,7 @@ public class DomElement { if (attributes == null) { - throw new DomEx(DomEx.NOT_FOUND_ERR, localPart, null, 0); + throw new DomDOMException(DOMException.NOT_FOUND_ERR, localPart, null, 0); } attributes.removeNamedItemNS (namespace, localPart); } @@ -487,11 +488,11 @@ public class DomElement { if (readonly) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (attr == null || attr.getOwnerElement() != this) { - throw new DomEx(DomEx.NOT_FOUND_ERR); + throw new DomDOMException(DOMException.NOT_FOUND_ERR); } if (isId) { Index: gnu/xml/dom/DomEx.java =================================================================== RCS file: gnu/xml/dom/DomEx.java diff -N gnu/xml/dom/DomEx.java --- gnu/xml/dom/DomEx.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,175 +0,0 @@ -/* DomEx.java -- - Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package gnu.xml.dom; - -import org.w3c.dom.DOMException; -import org.w3c.dom.Node; - -/** - *
DOMException implementation. The version that - * is provided by the W3C is abstract, so it can't be instantiated. - * - *
This also provides a bit more information about the error - * that is being reported, in terms of the relevant DOM structures - * and data. - * - * @author David Brownell - */ -public class DomEx - extends DOMException -{ - - /** @serial Data that caused an error to be reported */ - private String data; - - /** @serial Node associated with the error. */ - private Node node; - - /** @serial Data associated with the error. */ - private int value; - - /** - * Constructs an exception, with the diagnostic message - * corresponding to the specified code. - */ - public DomEx(short code) - { - super(code, diagnostic(code)); - } - - /** - * Constructs an exception, with the diagnostic message - * corresponding to the specified code and additional - * information as provided. - */ - public DomEx(short code, String data, Node node, int value) - { - super(code, diagnostic(code)); - this.data = data; - this.node = node; - this.value = value; - } - - /** Returns the node to which the diagnotic applies, or null. */ - final public Node getNode() - { - return node; - } - - /** Returns data to which the diagnotic applies, or null. */ - final public String getData() - { - return data; - } - - /** Returns data to which the diagnotic applies, or null. */ - final public int getValue() - { - return value; - } - - /** - * Returns a diagnostic message that may be slightly more useful - * than the generic one, where possible. - */ - public String getMessage() - { - String retval = super.getMessage(); - - if (data != null) - { - retval += "\nMore Information: " + data; - } - if (value != 0) - { - retval += "\nNumber: " + value; - } - if (node != null) - { - retval += "\nNode Name: " + node.getNodeName(); - } - return retval; - } - - // these strings should be localizable. - - private static String diagnostic(short code) - { - switch (code) - { - // DOM L1: - case INDEX_SIZE_ERR: - return "An index or size is out of range."; - case DOMSTRING_SIZE_ERR: - return "A string is too big."; - case HIERARCHY_REQUEST_ERR: - return "The node doesn't belong here."; - case WRONG_DOCUMENT_ERR: - return "The node belongs in another document."; - case INVALID_CHARACTER_ERR: - return "That character is not permitted."; - case NO_DATA_ALLOWED_ERR: - return "This node does not permit data."; - case NO_MODIFICATION_ALLOWED_ERR: - return "No changes are allowed."; - case NOT_FOUND_ERR: - return "The node was not found in that context."; - case NOT_SUPPORTED_ERR: - return "That object is not supported."; - case INUSE_ATTRIBUTE_ERR: - return "The attribute belongs to a different element."; - - // DOM L2: - case INVALID_STATE_ERR: - return "The object is not usable."; - case SYNTAX_ERR: - return "An illegal string was provided."; - case INVALID_MODIFICATION_ERR: - return "An object's type may not be changed."; - case NAMESPACE_ERR: - return "The operation violates XML Namespaces."; - case INVALID_ACCESS_ERR: - return "Parameter or operation isn't supported by this node."; - case TYPE_MISMATCH_ERR: - return "The type of the argument is incompatible with the expected type."; - } - return "Reserved exception number: " + code; - } - -} - Index: gnu/xml/dom/DomFragment.java =================================================================== RCS file: gnu/xml/dom/DomFragment.java diff -N gnu/xml/dom/DomFragment.java --- gnu/xml/dom/DomFragment.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,76 +0,0 @@ -/* DomFragment.java -- - Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package gnu.xml.dom; - -import org.w3c.dom.DocumentFragment; - -/** - *
"DocumentFragment" implementation.
- * - * @author David Brownell - * @author Chris Burdess - */ -public class DomFragment - extends DomNode - implements DocumentFragment -{ - - /** - * Constructs a DocumentFragment node associated with the - * specified document. - * - *This constructor should only be invoked by a Document as part of - * its createDocumentFragment functionality, or through a subclass which - * is similarly used in a "Sub-DOM" style layer. - */ - protected DomFragment(DomDocument owner) - { - super(DOCUMENT_FRAGMENT_NODE, owner); - } - - /** - * DOM L1 - * Returns the string "#document-fragment". - */ - final public String getNodeName() - { - return "#document-fragment"; - } - -} - Index: gnu/xml/dom/DomImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomImpl.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomImpl.java --- gnu/xml/dom/DomImpl.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/DomImpl.java 15 Feb 2005 20:55:15 -0000 @@ -207,7 +207,8 @@ public class DomImpl root = doc.createElementNS(namespaceURI, rootName); if (rootName.startsWith("xmlns:")) { - throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns is reserved", null, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "xmlns is reserved", null, 0); } } // Bleech -- L2 seemingly _requires_ omission of xmlns attributes. Index: gnu/xml/dom/DomIterator.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomIterator.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomIterator.java --- gnu/xml/dom/DomIterator.java 16 Jan 2005 15:15:09 -0000 1.1.2.1 +++ gnu/xml/dom/DomIterator.java 15 Feb 2005 20:55:15 -0000 @@ -37,8 +37,7 @@ exception statement from your version. * package gnu.xml.dom; -import java.util.Vector; - +import org.w3c.dom.DOMException; import org.w3c.dom.Node; import org.w3c.dom.events.Event; import org.w3c.dom.events.EventListener; @@ -76,7 +75,7 @@ public final class DomIterator { if (!root.isSupported("MutationEvents", "2.0")) { - throw new DomEx(DomEx.NOT_SUPPORTED_ERR, + throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, "Iterator needs mutation events", root, 0); } @@ -154,7 +153,7 @@ public final class DomIterator { if (done) { - throw new DomEx(DomEx.INVALID_STATE_ERR); + throw new DomDOMException(DOMException.INVALID_STATE_ERR); } right = true; return walk(true); @@ -171,7 +170,7 @@ public final class DomIterator { if (done) { - throw new DomEx(DomEx.INVALID_STATE_ERR); + throw new DomDOMException(DOMException.INVALID_STATE_ERR); } Node previous = reference; right = false; Index: gnu/xml/dom/DomNamedNodeMap.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomNamedNodeMap.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomNamedNodeMap.java --- gnu/xml/dom/DomNamedNodeMap.java 16 Jan 2005 15:15:10 -0000 1.1.2.1 +++ gnu/xml/dom/DomNamedNodeMap.java 15 Feb 2005 20:55:15 -0000 @@ -37,6 +37,7 @@ exception statement from your version. * package gnu.xml.dom; +import org.w3c.dom.DOMException; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; @@ -166,24 +167,24 @@ public class DomNamedNodeMap { if (readonly) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } DomNode node = (DomNode) arg; if (node.owner != owner.owner) { - throw new DomEx(DomEx.WRONG_DOCUMENT_ERR); + throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR); } if (node.nodeType != type) { - throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR); + throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR); } if (node.nodeType == Node.ATTRIBUTE_NODE) { DomNode element = node.parent; if (element != null && element != owner) { - throw new DomEx(DomEx.INUSE_ATTRIBUTE_ERR); + throw new DomDOMException(DOMException.INUSE_ATTRIBUTE_ERR); } node.parent = owner; node.depth = owner.depth + 1; @@ -302,7 +303,7 @@ public class DomNamedNodeMap { if (readonly) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } // report attribute REMOVAL event? @@ -369,7 +370,7 @@ public class DomNamedNodeMap return ctx; } } - throw new DomEx(DomEx.NOT_FOUND_ERR); + throw new DomDOMException(DOMException.NOT_FOUND_ERR); } String getDefaultValue(String name) Index: gnu/xml/dom/DomNode.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomNode.java,v retrieving revision 1.1.2.2 diff -u -3 -p -u -r1.1.2.2 DomNode.java --- gnu/xml/dom/DomNode.java 29 Jan 2005 02:45:23 -0000 1.1.2.2 +++ gnu/xml/dom/DomNode.java 15 Feb 2005 20:55:16 -0000 @@ -40,7 +40,6 @@ package gnu.xml.dom; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import javax.xml.XMLConstants; import org.w3c.dom.Document; import org.w3c.dom.DOMException; @@ -58,7 +57,6 @@ import org.w3c.dom.events.EventTarget; import org.w3c.dom.events.MutationEvent; import org.w3c.dom.traversal.NodeFilter; import org.w3c.dom.traversal.NodeIterator; -import org.w3c.dom.traversal.TreeWalker; /** *
"Node", "EventTarget", and "DocumentEvent" implementation. @@ -308,15 +306,16 @@ public abstract class DomNode { if (readonly && !owner.building) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, - null, this, 0); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, + null, this, 0); } for (DomNode ctx = this; ctx != null; ctx = ctx.parent) { if (child == ctx) { - throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, - "can't make ancestor into a child", this, 0); + throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, + "can't make ancestor into a child", + this, 0); } } @@ -330,8 +329,8 @@ public abstract class DomNode // new in DOM L2, this case -- patch it up later, in reparent() if (!(childNodeType == DOCUMENT_TYPE_NODE && childOwner == null)) { - throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, - null, child, 0); + throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, + null, child, 0); } } @@ -376,10 +375,12 @@ public abstract class DomNode } if (owner.checkingWellformedness) { - throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, - "can't append " + nodeTypeToString(childNodeType) + - " to node of type " + nodeTypeToString(nodeType), - this, 0); + throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, + "can't append " + + nodeTypeToString(childNodeType) + + " to node of type " + + nodeTypeToString(nodeType), + this, 0); } } @@ -578,8 +579,8 @@ public abstract class DomNode } catch (ClassCastException e) { - throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, - null, newChild, 0); + throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, + null, newChild, 0); } } @@ -630,12 +631,14 @@ public abstract class DomNode checkMisc(child); if (ref == null || ref.parent != this) { - throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); + throw new DomDOMException(DOMException.NOT_FOUND_ERR, + null, ref, 0); } if (ref == child) { - throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR, - "can't insert node before itself", ref, 0); + throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR, + "can't insert node before itself", + ref, 0); } if (child.parent != null) @@ -672,8 +675,8 @@ public abstract class DomNode } catch (ClassCastException e) { - throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, - null, newChild, 0); + throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, + null, newChild, 0); } } @@ -721,7 +724,8 @@ public abstract class DomNode } if (ref == null || ref.parent != this) { - throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); + throw new DomDOMException(DOMException.NOT_FOUND_ERR, + null, ref, 0); } if (reportMutations) @@ -784,7 +788,8 @@ public abstract class DomNode checkMisc(child); if (ref == null || ref.parent != this) { - throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); + throw new DomDOMException(DOMException.NOT_FOUND_ERR, + null, ref, 0); } if (reportMutations) @@ -837,8 +842,8 @@ public abstract class DomNode } catch (ClassCastException e) { - throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, - null, newChild, 0); + throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, + null, newChild, 0); } } @@ -860,12 +865,13 @@ public abstract class DomNode if (ref == null || ref.parent != this) { - throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); + throw new DomDOMException(DOMException.NOT_FOUND_ERR, + null, ref, 0); } if (readonly && !owner.building) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, - null, this, 0); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, + null, this, 0); } for (DomNode child = first; child != null; child = child.next) @@ -909,13 +915,13 @@ public abstract class DomNode return ref; } } - throw new DomEx(DomEx.NOT_FOUND_ERR, - "that's no child of mine", refChild, 0); + throw new DomDOMException(DOMException.NOT_FOUND_ERR, + "that's no child of mine", refChild, 0); } catch (ClassCastException e) { - throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, - null, refChild, 0); + throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR, + null, refChild, 0); } } @@ -1446,8 +1452,8 @@ public abstract class DomNode // mouse events - throw new DomEx(DomEx.NOT_SUPPORTED_ERR, - eventType, null, 0); + throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR, + eventType, null, 0); } /** Index: gnu/xml/dom/DomNsNode.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomNsNode.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 DomNsNode.java --- gnu/xml/dom/DomNsNode.java 16 Jan 2005 15:15:10 -0000 1.1.2.1 +++ gnu/xml/dom/DomNsNode.java 15 Feb 2005 20:55:16 -0000 @@ -38,6 +38,7 @@ exception statement from your version. * package gnu.xml.dom; import javax.xml.XMLConstants; +import org.w3c.dom.DOMException; /** *
Abstract implemention of namespace support. This facilitates @@ -135,7 +136,7 @@ public abstract class DomNsNode { if (readonly) { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); + throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } if (prefix == null) @@ -145,40 +146,42 @@ public abstract class DomNsNode } else if (namespace == null) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "can't set prefix, node has no namespace URI", - this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "can't set prefix, node has no namespace URI", + this, 0); } DomDocument.checkName(prefix, "1.1".equals(owner.getXmlVersion())); if (prefix.indexOf (':') != -1) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "illegal prefix " + prefix, this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "illegal prefix " + prefix, this, 0); } if (XMLConstants.XML_NS_PREFIX.equals(prefix) && !XMLConstants.XML_NS_URI.equals(namespace)) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "xml namespace is always " + - XMLConstants.XML_NS_URI, this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "xml namespace is always " + + XMLConstants.XML_NS_URI, this, 0); } if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) { if (namespace != null || getNodeType() != ATTRIBUTE_NODE) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "xmlns attribute prefix is reserved", this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "xmlns attribute prefix is reserved", + this, 0); } } else if (getNodeType () == ATTRIBUTE_NODE && (XMLConstants.XMLNS_ATTRIBUTE.equals(name) || name.startsWith("xmlns:"))) { - throw new DomEx(DomEx.NAMESPACE_ERR, - "namespace declarations can't change names", this, 0); + throw new DomDOMException(DOMException.NAMESPACE_ERR, + "namespace declarations can't change names", + this, 0); } this.prefix = prefix.intern(); Index: gnu/xml/dom/DomPI.java =================================================================== RCS file: gnu/xml/dom/DomPI.java diff -N gnu/xml/dom/DomPI.java --- gnu/xml/dom/DomPI.java 16 Jan 2005 15:15:10 -0000 1.1.2.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,145 +0,0 @@ -/* DomPI.java -- - Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package gnu.xml.dom; - -import org.w3c.dom.ProcessingInstruction; - -/** - *
"ProcessingInstruction" (PI) implementation. - * This is a non-core DOM class, supporting the "XML" feature.
- * - *Unlike other DOM APIs in the "XML" feature, this one fully - * exposes the functionality it describes. So there is no reason - * inherent in DOM to avoid using this API, unless you want to rely - * on NOTATION declarations to associate meaning with your PIs; - * there is no vendor-neutal way to record those notations in DOM.
- * - *Also of note is that PI support is part of SAX, so that XML - * systems using PIs can choose among multiple APIs.
- * - * @see DomNotation - * - * @author David Brownell - * @author Chris Burdess - */ -public class DomPI - extends DomNode - implements ProcessingInstruction -{ - - private String target; - private String data; - - /** - * Constructs a ProcessingInstruction node associated with the - * specified document, with the specified data. - * - *This constructor should only be invoked by a Document object as - * part of its createProcessingInstruction functionality, or through - * a subclass which is similarly used in a "Sub-DOM" style layer. - */ - protected DomPI(DomDocument owner, String target, String data) - { - super(PROCESSING_INSTRUCTION_NODE, owner); - this.target = target; - this.data = data; - } - - /** - * DOM L1 - * Returns the target of the processing instruction. - */ - public final String getTarget() - { - return target; - } - - /** - * DOM L1 - * Returns the target of the processing instruction - * (same as getTarget). - */ - public final String getNodeName() - { - return target; - } - - /** - * DOM L1 - * Returns the data associated with the processing instruction. - */ - public final String getData() - { - return data; - } - - /** - * DOM L1 - * Returns the data associated with the processing instruction - * (same as getData). - */ - public final String getNodeValue() - { - return data; - } - - /** - * DOM L1 - * Assigns the data associated with the processing instruction; - * same as setNodeValue. - */ - public final void setData(String data) - { - setNodeValue(data); - } - - /** - * DOM L1 - * Assigns the data associated with the processing instruction. - */ - public final void setNodeValue(String data) - { - if (isReadonly()) - { - throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); - } - this.data = data; - } - -} - Index: gnu/xml/dom/DomProcessingInstruction.java =================================================================== RCS file: gnu/xml/dom/DomProcessingInstruction.java diff -N gnu/xml/dom/DomProcessingInstruction.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/xml/dom/DomProcessingInstruction.java 15 Feb 2005 20:55:16 -0000 @@ -0,0 +1,147 @@ +/* DomProcessingInstruction.java -- + Copyright (C) 1999,2000,2001,2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.xml.dom; + +import org.w3c.dom.DOMException; +import org.w3c.dom.ProcessingInstruction; + +/** + *
"ProcessingInstruction" (PI) implementation. + * This is a non-core DOM class, supporting the "XML" feature.
+ * + *Unlike other DOM APIs in the "XML" feature, this one fully + * exposes the functionality it describes. So there is no reason + * inherent in DOM to avoid using this API, unless you want to rely + * on NOTATION declarations to associate meaning with your PIs; + * there is no vendor-neutal way to record those notations in DOM.
+ * + *Also of note is that PI support is part of SAX, so that XML + * systems using PIs can choose among multiple APIs.
+ * + * @see DomNotation + * + * @author David Brownell + * @author Chris Burdess + */ +public class DomProcessingInstruction + extends DomNode + implements ProcessingInstruction +{ + + private String target; + private String data; + + /** + * Constructs a ProcessingInstruction node associated with the + * specified document, with the specified data. + * + *This constructor should only be invoked by a Document object as
+ * part of its createProcessingInstruction functionality, or through
+ * a subclass which is similarly used in a "Sub-DOM" style layer.
+ */
+ protected DomProcessingInstruction(DomDocument owner,
+ String target, String data)
+ {
+ super(PROCESSING_INSTRUCTION_NODE, owner);
+ this.target = target;
+ this.data = data;
+ }
+
+ /**
+ * DOM L1
+ * Returns the target of the processing instruction.
+ */
+ public final String getTarget()
+ {
+ return target;
+ }
+
+ /**
+ * DOM L1
+ * Returns the target of the processing instruction
+ * (same as getTarget).
+ */
+ public final String getNodeName()
+ {
+ return target;
+ }
+
+ /**
+ * DOM L1
+ * Returns the data associated with the processing instruction.
+ */
+ public final String getData()
+ {
+ return data;
+ }
+
+ /**
+ * DOM L1
+ * Returns the data associated with the processing instruction
+ * (same as getData).
+ */
+ public final String getNodeValue()
+ {
+ return data;
+ }
+
+ /**
+ * DOM L1
+ * Assigns the data associated with the processing instruction;
+ * same as setNodeValue.
+ */
+ public final void setData(String data)
+ {
+ setNodeValue(data);
+ }
+
+ /**
+ * DOM L1
+ * Assigns the data associated with the processing instruction.
+ */
+ public final void setNodeValue(String data)
+ {
+ if (isReadonly())
+ {
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
+ }
+ this.data = data;
+ }
+
+}
+
Index: gnu/xml/dom/DomText.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomText.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DomText.java
--- gnu/xml/dom/DomText.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/dom/DomText.java 15 Feb 2005 20:55:16 -0000
@@ -102,7 +102,7 @@ public class DomText
{
if (isReadonly())
{
- throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR);
+ throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR);
}
try
{
@@ -134,7 +134,7 @@ public class DomText
}
catch (IndexOutOfBoundsException x)
{
- throw new DomEx(DomEx.INDEX_SIZE_ERR);
+ throw new DomDOMException(DOMException.INDEX_SIZE_ERR);
}
}
Index: gnu/xml/dom/DomXPathExpression.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomXPathExpression.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DomXPathExpression.java
--- gnu/xml/dom/DomXPathExpression.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/dom/DomXPathExpression.java 15 Feb 2005 20:55:16 -0000
@@ -37,7 +37,6 @@ exception statement from your version. *
package gnu.xml.dom;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Index: gnu/xml/dom/DomXPathResult.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomXPathResult.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DomXPathResult.java
--- gnu/xml/dom/DomXPathResult.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/dom/DomXPathResult.java 15 Feb 2005 20:55:16 -0000
@@ -39,10 +39,8 @@ package gnu.xml.dom;
import java.util.Collection;
import java.util.Iterator;
-import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.xpath.XPathException;
-import org.w3c.dom.xpath.XPathNSResolver;
import org.w3c.dom.xpath.XPathResult;
/**
Index: gnu/xml/dom/JAXPFactory.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/JAXPFactory.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 JAXPFactory.java
--- gnu/xml/dom/JAXPFactory.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/dom/JAXPFactory.java 15 Feb 2005 20:55:16 -0000
@@ -40,7 +40,6 @@ package gnu.xml.dom;
import java.io.IOException;
import org.w3c.dom.Document;
-import org.w3c.dom.DocumentType;
import org.w3c.dom.DOMImplementation;
import org.xml.sax.EntityResolver;
Index: gnu/xml/dom/ls/DomLSEx.java
===================================================================
RCS file: gnu/xml/dom/ls/DomLSEx.java
diff -N gnu/xml/dom/ls/DomLSEx.java
--- gnu/xml/dom/ls/DomLSEx.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,75 +0,0 @@
-/* DomLSEx.java --
- Copyright (C) 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package gnu.xml.dom.ls;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import org.w3c.dom.ls.LSException;
-
-/**
- * A DOM LS exception incorporating a cause.
- *
- * @author Chris Burdess
- */
-public class DomLSEx
- extends LSException
-{
-
- private final Exception cause2;
-
- public DomLSEx(short type, Exception cause)
- {
- super(type, cause.getMessage());
- cause2 = cause;
- }
-
- public void printStackTrace(PrintStream out)
- {
- super.printStackTrace(out);
- out.print("caused by ");
- cause2.printStackTrace(out);
- }
-
- public void printStackTrace(PrintWriter out)
- {
- super.printStackTrace(out);
- out.print("caused by ");
- cause2.printStackTrace(out);
- }
-
-}
Index: gnu/xml/dom/ls/DomLSException.java
===================================================================
RCS file: gnu/xml/dom/ls/DomLSException.java
diff -N gnu/xml/dom/ls/DomLSException.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gnu/xml/dom/ls/DomLSException.java 15 Feb 2005 20:55:16 -0000
@@ -0,0 +1,57 @@
+/* DomLSException.java --
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.xml.dom.ls;
+
+import org.w3c.dom.ls.LSException;
+
+/**
+ * A DOM LS exception incorporating a cause.
+ *
+ * @author Chris Burdess
+ */
+public class DomLSException
+ extends LSException
+{
+
+ public DomLSException(short type, Exception cause)
+ {
+ super(type, (cause == null) ? null : cause.getMessage());
+ initCause(cause);
+ }
+
+}
Index: gnu/xml/dom/ls/DomLSParser.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/ls/DomLSParser.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DomLSParser.java
--- gnu/xml/dom/ls/DomLSParser.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/dom/ls/DomLSParser.java 15 Feb 2005 20:55:16 -0000
@@ -65,7 +65,7 @@ import org.xml.sax.SAXNotRecognizedExcep
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import gnu.xml.dom.DomDocument;
-import gnu.xml.dom.DomEx;
+import gnu.xml.dom.DomDOMException;
/**
* Parser implementation for GNU DOM.
@@ -117,7 +117,7 @@ public class DomLSParser
async = false;
break;
default:
- throw new DomEx(DOMException.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
// TODO schemaType
this.schemaType = schemaType;
@@ -307,13 +307,13 @@ public class DomLSParser
{
reader = null;
eventSink = null;
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
catch (IOException e)
{
reader = null;
eventSink = null;
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
// return document
Document ret = eventSink.doc;
@@ -341,11 +341,11 @@ public class DomLSParser
}
catch (ParserConfigurationException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
catch (SAXException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
}
return reader;
@@ -371,11 +371,11 @@ public class DomLSParser
}
catch (SAXException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
catch (IOException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
}
if (source == null)
@@ -403,7 +403,7 @@ public class DomLSParser
}
catch (IOException e)
{
- throw new DomLSEx(LSException.PARSE_ERR, e);
+ throw new DomLSException(LSException.PARSE_ERR, e);
}
}
return source;
@@ -457,7 +457,7 @@ public class DomLSParser
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
// invalidate reader, a new one will be created
reader = null;
@@ -509,7 +509,7 @@ public class DomLSParser
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
}
Index: gnu/xml/dom/ls/DomLSSerializer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/ls/DomLSSerializer.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DomLSSerializer.java
--- gnu/xml/dom/ls/DomLSSerializer.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/dom/ls/DomLSSerializer.java 15 Feb 2005 20:55:16 -0000
@@ -58,7 +58,7 @@ import org.w3c.dom.ls.LSOutput;
import org.w3c.dom.ls.LSSerializer;
import org.w3c.dom.ls.LSSerializerFilter;
import org.w3c.dom.traversal.NodeFilter;
-import gnu.xml.dom.DomEx;
+import gnu.xml.dom.DomDOMException;
import gnu.xml.transform.StreamSerializer;
/**
@@ -147,7 +147,7 @@ public class DomLSSerializer
}
catch (IOException e)
{
- throw new DomLSEx(LSException.SERIALIZE_ERR, e);
+ throw new DomLSException(LSException.SERIALIZE_ERR, e);
}
}
@@ -302,7 +302,7 @@ public class DomLSSerializer
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
}
@@ -319,7 +319,7 @@ public class DomLSSerializer
}
else
{
- throw new DomEx(DomEx.NOT_SUPPORTED_ERR);
+ throw new DomDOMException(DOMException.NOT_SUPPORTED_ERR);
}
}
Index: gnu/xml/libxmlj/dom/GnomeDocumentBuilder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/libxmlj/dom/GnomeDocumentBuilder.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 GnomeDocumentBuilder.java
--- gnu/xml/libxmlj/dom/GnomeDocumentBuilder.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/libxmlj/dom/GnomeDocumentBuilder.java 15 Feb 2005 20:55:16 -0000
@@ -37,12 +37,8 @@ exception statement from your version. *
package gnu.xml.libxmlj.dom;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.IOException;
-import java.io.PushbackInputStream;
-import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.parsers.DocumentBuilder;
Index: gnu/xml/libxmlj/dom/GnomeXPathNodeList.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/libxmlj/dom/GnomeXPathNodeList.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 GnomeXPathNodeList.java
--- gnu/xml/libxmlj/dom/GnomeXPathNodeList.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/libxmlj/dom/GnomeXPathNodeList.java 15 Feb 2005 20:55:16 -0000
@@ -37,7 +37,6 @@ exception statement from your version. *
package gnu.xml.libxmlj.dom;
-import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Index: gnu/xml/libxmlj/sax/GnomeXMLReader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/libxmlj/sax/GnomeXMLReader.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 GnomeXMLReader.java
--- gnu/xml/libxmlj/sax/GnomeXMLReader.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/libxmlj/sax/GnomeXMLReader.java 15 Feb 2005 20:55:16 -0000
@@ -38,19 +38,15 @@ exception statement from your version. *
package gnu.xml.libxmlj.sax;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.IOException;
-import java.io.PushbackInputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
Index: gnu/xml/libxmlj/transform/GnomeTransformer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/libxmlj/transform/GnomeTransformer.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 GnomeTransformer.java
--- gnu/xml/libxmlj/transform/GnomeTransformer.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/libxmlj/transform/GnomeTransformer.java 15 Feb 2005 20:55:16 -0000
@@ -37,14 +37,9 @@ exception statement from your version. *
package gnu.xml.libxmlj.transform;
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.PushbackInputStream;
import java.net.URL;
@@ -65,7 +60,6 @@ import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
Index: gnu/xml/libxmlj/transform/GnomeTransformerFactory.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/libxmlj/transform/GnomeTransformerFactory.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 GnomeTransformerFactory.java
--- gnu/xml/libxmlj/transform/GnomeTransformerFactory.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/libxmlj/transform/GnomeTransformerFactory.java 15 Feb 2005 20:55:16 -0000
@@ -51,7 +51,6 @@ import javax.xml.transform.ErrorListener
import javax.xml.transform.Source;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.URIResolver;
Index: gnu/xml/libxmlj/util/XMLJ.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/libxmlj/util/XMLJ.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 XMLJ.java
--- gnu/xml/libxmlj/util/XMLJ.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/libxmlj/util/XMLJ.java 15 Feb 2005 20:55:16 -0000
@@ -42,7 +42,6 @@ import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.PushbackInputStream;
import java.io.Reader;
import java.io.Writer;
import java.net.MalformedURLException;
Index: gnu/xml/pipeline/CallFilter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/pipeline/CallFilter.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 CallFilter.java
--- gnu/xml/pipeline/CallFilter.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/pipeline/CallFilter.java 15 Feb 2005 20:55:16 -0000
@@ -37,11 +37,18 @@ exception statement from your version. *
package gnu.xml.pipeline;
-import java.io.*;
-import java.net.*;
-
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+import java.net.URLConnection;
+import java.io.Writer;
+
+import org.xml.sax.DTDHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
import gnu.xml.util.Resolver;
Index: gnu/xml/pipeline/DomConsumer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/pipeline/DomConsumer.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DomConsumer.java
--- gnu/xml/pipeline/DomConsumer.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/pipeline/DomConsumer.java 15 Feb 2005 20:55:19 -0000
@@ -37,17 +37,30 @@ exception statement from your version. *
package gnu.xml.pipeline;
-import java.util.Hashtable;
+import gnu.xml.aelfred2.ContentHandler2;
+import gnu.xml.util.DomParser;
-import org.w3c.dom.*;
-import org.xml.sax.*;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXParseException;
import org.xml.sax.ext.DeclHandler;
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.helpers.AttributesImpl;
-
-import gnu.xml.aelfred2.ContentHandler2;
-import gnu.xml.util.DomParser;
-
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.CharacterData;
+import org.w3c.dom.Document;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.Node;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.Text;
/**
* This consumer builds a DOM Document from its input, acting either as a
Index: gnu/xml/pipeline/LinkFilter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/pipeline/LinkFilter.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 LinkFilter.java
--- gnu/xml/pipeline/LinkFilter.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/pipeline/LinkFilter.java 15 Feb 2005 20:55:19 -0000
@@ -43,7 +43,6 @@ import java.util.Enumeration;
import java.util.Vector;
import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
import org.xml.sax.SAXException;
Index: gnu/xml/pipeline/NSFilter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/pipeline/NSFilter.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 NSFilter.java
--- gnu/xml/pipeline/NSFilter.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/pipeline/NSFilter.java 15 Feb 2005 20:55:19 -0000
@@ -37,16 +37,17 @@ exception statement from your version. *
package gnu.xml.pipeline;
-import java.util.EmptyStackException;
import java.util.Enumeration;
import java.util.Stack;
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
+import org.xml.sax.Attributes;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.NamespaceSupport;
-
/**
* This filter ensures that element and attribute names are properly prefixed,
* and that such prefixes are declared. Such data is critical for operations
Index: gnu/xml/pipeline/TeeConsumer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/pipeline/TeeConsumer.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 TeeConsumer.java
--- gnu/xml/pipeline/TeeConsumer.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/pipeline/TeeConsumer.java 15 Feb 2005 20:55:19 -0000
@@ -37,11 +37,15 @@ exception statement from your version. *
package gnu.xml.pipeline;
-import java.io.IOException;
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-//import gnu.xml.util;
-
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.ext.LexicalHandler;
/**
* Fans its events out to two other consumers, a "tee" filter stage in an
Index: gnu/xml/pipeline/ValidationConsumer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/pipeline/ValidationConsumer.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 ValidationConsumer.java
--- gnu/xml/pipeline/ValidationConsumer.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/pipeline/ValidationConsumer.java 15 Feb 2005 20:55:19 -0000
@@ -37,8 +37,9 @@ exception statement from your version. *
package gnu.xml.pipeline;
-import java.io.*;
-
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
import java.util.EmptyStackException;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -46,11 +47,16 @@ import java.util.Stack;
import java.util.StringTokenizer;
import java.util.Vector;
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
+import org.xml.sax.Attributes;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
-
/**
* This class checks SAX2 events to report validity errors; it works as
* both a filter and a terminus on an event pipeline. It relies on the
Index: gnu/xml/pipeline/WellFormednessFilter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/pipeline/WellFormednessFilter.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 WellFormednessFilter.java
--- gnu/xml/pipeline/WellFormednessFilter.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/pipeline/WellFormednessFilter.java 15 Feb 2005 20:55:19 -0000
@@ -40,10 +40,11 @@ package gnu.xml.pipeline;
import java.util.EmptyStackException;
import java.util.Stack;
-import gnu.xml.aelfred2.SAXDriver;
-import org.xml.sax.*;
-import org.xml.sax.ext.*;
-
+import org.xml.sax.Attributes;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
/**
* This filter reports fatal exceptions in the case of event streams that
Index: gnu/xml/pipeline/XIncludeFilter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/pipeline/XIncludeFilter.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 XIncludeFilter.java
--- gnu/xml/pipeline/XIncludeFilter.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/pipeline/XIncludeFilter.java 15 Feb 2005 20:55:19 -0000
@@ -42,7 +42,6 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
-import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Stack;
import java.util.Vector;
Index: gnu/xml/pipeline/XsltFilter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/pipeline/XsltFilter.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 XsltFilter.java
--- gnu/xml/pipeline/XsltFilter.java 16 Jan 2005 15:15:10 -0000 1.1.2.1
+++ gnu/xml/pipeline/XsltFilter.java 15 Feb 2005 20:55:19 -0000
@@ -44,7 +44,6 @@ import javax.xml.transform.TransformerCo
import javax.xml.transform.sax.*;
import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
import org.xml.sax.ext.LexicalHandler;
Index: gnu/xml/transform/ApplyImportsNode.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/ApplyImportsNode.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 ApplyImportsNode.java
--- gnu/xml/transform/ApplyImportsNode.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/ApplyImportsNode.java 15 Feb 2005 20:55:19 -0000
@@ -37,15 +37,9 @@ exception statement from your version. *
package gnu.xml.transform;
-import java.util.Collection;
-import java.util.Iterator;
-import java.text.DecimalFormat;
import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import gnu.xml.xpath.Expr;
/**
* A template node representing an XSLT apply-imports
instruction.
Index: gnu/xml/transform/Bindings.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/Bindings.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 Bindings.java
--- gnu/xml/transform/Bindings.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/Bindings.java 15 Feb 2005 20:55:19 -0000
@@ -45,12 +45,8 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
import javax.xml.xpath.XPathVariableResolver;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
-import gnu.xml.xpath.Expr;
/**
* The set of variable bindings in effect for a stylesheet.
Index: gnu/xml/transform/DocumentFunction.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/DocumentFunction.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DocumentFunction.java
--- gnu/xml/transform/DocumentFunction.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/DocumentFunction.java 15 Feb 2005 20:55:19 -0000
@@ -37,22 +37,16 @@ exception statement from your version. *
package gnu.xml.transform;
-import java.io.InputStream;
-import java.io.IOException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
-import javax.xml.transform.ErrorListener;
import javax.xml.transform.TransformerException;
-import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMSource;
import javax.xml.xpath.XPathFunction;
import javax.xml.xpath.XPathFunctionException;
-import org.w3c.dom.Document;
import org.w3c.dom.Node;
import gnu.xml.xpath.Constant;
import gnu.xml.xpath.Expr;
Index: gnu/xml/transform/FormatNumberFunction.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/FormatNumberFunction.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 FormatNumberFunction.java
--- gnu/xml/transform/FormatNumberFunction.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/FormatNumberFunction.java 15 Feb 2005 20:55:19 -0000
@@ -38,7 +38,6 @@ exception statement from your version. *
package gnu.xml.transform;
import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
Index: gnu/xml/transform/NodeNumberNode.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/NodeNumberNode.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 NodeNumberNode.java
--- gnu/xml/transform/NodeNumberNode.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/NodeNumberNode.java 15 Feb 2005 20:55:19 -0000
@@ -43,13 +43,10 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
import org.w3c.dom.Node;
import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.NodeTypeTest;
import gnu.xml.xpath.Pattern;
import gnu.xml.xpath.Selector;
-import gnu.xml.xpath.Test;
import gnu.xml.xpath.UnionExpr;
/**
Index: gnu/xml/transform/NumberNode.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/NumberNode.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 NumberNode.java
--- gnu/xml/transform/NumberNode.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/NumberNode.java 15 Feb 2005 20:55:19 -0000
@@ -38,7 +38,6 @@ exception statement from your version. *
package gnu.xml.transform;
import javax.xml.transform.TransformerException;
-import org.w3c.dom.Document;
import org.w3c.dom.Node;
import gnu.xml.xpath.Expr;
Index: gnu/xml/transform/Stylesheet.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/Stylesheet.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 Stylesheet.java
--- gnu/xml/transform/Stylesheet.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/Stylesheet.java 15 Feb 2005 20:55:19 -0000
@@ -58,7 +58,6 @@ import javax.xml.namespace.QName;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFunction;
import javax.xml.xpath.XPathFunctionResolver;
import javax.xml.xpath.XPathExpressionException;
@@ -68,7 +67,6 @@ import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.w3c.dom.UserDataHandler;
import gnu.xml.xpath.Expr;
Index: gnu/xml/transform/SystemPropertyFunction.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/SystemPropertyFunction.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 SystemPropertyFunction.java
--- gnu/xml/transform/SystemPropertyFunction.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/SystemPropertyFunction.java 15 Feb 2005 20:55:19 -0000
@@ -38,7 +38,6 @@ exception statement from your version. *
package gnu.xml.transform;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.xpath.XPathFunction;
Index: gnu/xml/transform/Template.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/Template.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 Template.java
--- gnu/xml/transform/Template.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/Template.java 15 Feb 2005 20:55:19 -0000
@@ -39,9 +39,7 @@ package gnu.xml.transform;
import java.io.PrintStream;
import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathExpressionException;
import org.w3c.dom.Node;
import gnu.xml.xpath.Expr;
import gnu.xml.xpath.NameTest;
Index: gnu/xml/transform/TemplatesImpl.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/TemplatesImpl.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 TemplatesImpl.java
--- gnu/xml/transform/TemplatesImpl.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/TemplatesImpl.java 15 Feb 2005 20:55:19 -0000
@@ -38,12 +38,9 @@ exception statement from your version. *
package gnu.xml.transform;
import java.util.Properties;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.Source;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.URIResolver;
/**
* GNU precompiled stylesheet implementation.
Index: gnu/xml/transform/TransformerImpl.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/TransformerImpl.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 TransformerImpl.java
--- gnu/xml/transform/TransformerImpl.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/TransformerImpl.java 15 Feb 2005 20:55:19 -0000
@@ -48,9 +48,6 @@ import java.net.UnknownServiceException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
import java.util.Properties;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.OutputKeys;
@@ -67,7 +64,6 @@ import javax.xml.transform.stream.Stream
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
import org.xml.sax.ContentHandler;
@@ -76,8 +72,6 @@ import org.xml.sax.ext.LexicalHandler;
import gnu.xml.dom.DomDoctype;
import gnu.xml.dom.DomDocument;
import gnu.xml.dom.ls.WriterOutputStream;
-import gnu.xml.xpath.Expr;
-import gnu.xml.xpath.Root;
/**
* The transformation process for a given stylesheet.
Index: gnu/xml/transform/ValueOfNode.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/ValueOfNode.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 ValueOfNode.java
--- gnu/xml/transform/ValueOfNode.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/ValueOfNode.java 15 Feb 2005 20:55:19 -0000
@@ -37,9 +37,6 @@ exception statement from your version. *
package gnu.xml.transform;
-import java.util.Collection;
-import java.util.Iterator;
-import java.text.DecimalFormat;
import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
import org.w3c.dom.Document;
Index: gnu/xml/transform/XSLURIResolver.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/XSLURIResolver.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 XSLURIResolver.java
--- gnu/xml/transform/XSLURIResolver.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/transform/XSLURIResolver.java 15 Feb 2005 20:55:19 -0000
@@ -41,7 +41,6 @@ import java.io.File;
import java.io.InputStream;
import java.io.IOException;
import java.io.Reader;
-import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
Index: gnu/xml/util/DoParse.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/util/DoParse.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DoParse.java
--- gnu/xml/util/DoParse.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/util/DoParse.java 15 Feb 2005 20:55:19 -0000
@@ -37,28 +37,22 @@ exception statement from your version. *
package gnu.xml.util;
-import java.io.*;
+import java.io.IOException;
-import org.xml.sax.*;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
-import org.xml.sax.ext.*;
-// import gnu.xml.pipeline.*;
-// Added imports directly to fix a GCJ problem.
-import gnu.xml.pipeline.CallFilter;
-import gnu.xml.pipeline.DomConsumer;
import gnu.xml.pipeline.EventConsumer;
import gnu.xml.pipeline.EventFilter;
-import gnu.xml.pipeline.LinkFilter;
import gnu.xml.pipeline.NSFilter;
import gnu.xml.pipeline.PipelineFactory;
import gnu.xml.pipeline.TeeConsumer;
-import gnu.xml.pipeline.TextConsumer;
import gnu.xml.pipeline.ValidationConsumer;
import gnu.xml.pipeline.WellFormednessFilter;
-import gnu.xml.pipeline.XIncludeFilter;
-import gnu.xml.pipeline.XsltFilter;
-
/**
* This class provides a driver which may be invoked from the command line
Index: gnu/xml/util/Resolver.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/util/Resolver.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 Resolver.java
--- gnu/xml/util/Resolver.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/util/Resolver.java 15 Feb 2005 20:55:19 -0000
@@ -37,13 +37,13 @@ exception statement from your version. *
package gnu.xml.util;
-import java.io.*;
-
+import java.io.File;
+import java.io.IOException;
import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.xml.sax.*;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
/**
* Utility implementation of a SAX resolver, which can be used to improve
Index: gnu/xml/util/SAXNullTransformerFactory.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/util/SAXNullTransformerFactory.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 SAXNullTransformerFactory.java
--- gnu/xml/util/SAXNullTransformerFactory.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/util/SAXNullTransformerFactory.java 15 Feb 2005 20:55:19 -0000
@@ -635,7 +635,8 @@ public class SAXNullTransformerFactory e
// preserve original namespace prefixes
try
{
- producer.setFeature(handler.FEATURE_URI + "namespace-prefixes",
+ producer.setFeature(EventFilter.FEATURE_URI +
+ "namespace-prefixes",
true);
}
catch (Exception e)
@@ -646,7 +647,7 @@ public class SAXNullTransformerFactory e
// arrange the output
handler.setResult (out);
- handler.bind (producer, handler);
+ EventFilter.bind (producer, handler);
// then parse ... single element pipeline
producer.parse (input);
Index: gnu/xml/xpath/Expr.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/xpath/Expr.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 Expr.java
--- gnu/xml/xpath/Expr.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/xpath/Expr.java 15 Feb 2005 20:55:19 -0000
@@ -58,9 +58,7 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import org.w3c.dom.Document;
-import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
Index: gnu/xml/xpath/FunctionCall.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/xpath/FunctionCall.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 FunctionCall.java
--- gnu/xml/xpath/FunctionCall.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/xpath/FunctionCall.java 15 Feb 2005 20:55:19 -0000
@@ -38,7 +38,6 @@ exception statement from your version. *
package gnu.xml.xpath;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.xml.namespace.QName;
Index: gnu/xml/xpath/Predicate.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/xpath/Predicate.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 Predicate.java
--- gnu/xml/xpath/Predicate.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/xpath/Predicate.java 15 Feb 2005 20:55:19 -0000
@@ -63,7 +63,7 @@ class Predicate
// Same as [position() = x]
return ((Double) ret).intValue() == pos;
}
- return expr._boolean(node, expr.evaluate(node, pos, len));
+ return Expr._boolean(node, expr.evaluate(node, pos, len));
}
public Test clone(Object context)
Index: gnu/xml/xpath/RelationalExpr.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/xpath/RelationalExpr.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 RelationalExpr.java
--- gnu/xml/xpath/RelationalExpr.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/xpath/RelationalExpr.java 15 Feb 2005 20:55:19 -0000
@@ -37,7 +37,6 @@ exception statement from your version. *
package gnu.xml.xpath;
-import java.util.Collection;
import org.w3c.dom.Node;
/**
Index: gnu/xml/xpath/Selector.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/xpath/Selector.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 Selector.java
--- gnu/xml/xpath/Selector.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/xpath/Selector.java 15 Feb 2005 20:55:19 -0000
@@ -39,7 +39,6 @@ package gnu.xml.xpath;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
@@ -48,7 +47,6 @@ import javax.xml.XMLConstants;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
* A single component of a location path.
Index: gnu/xml/xpath/XPathParser.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/xpath/XPathParser.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 XPathParser.java
--- gnu/xml/xpath/XPathParser.java 16 Jan 2005 15:15:11 -0000 1.1.2.1
+++ gnu/xml/xpath/XPathParser.java 15 Feb 2005 20:55:19 -0000
@@ -43,7 +43,6 @@ package gnu.xml.xpath;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import javax.xml.xpath.XPathFunctionResolver;
Index: include/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/include/Makefile.am,v
retrieving revision 1.27.2.5
diff -u -3 -p -u -r1.27.2.5 Makefile.am
--- include/Makefile.am 16 Jan 2005 15:15:11 -0000 1.27.2.5
+++ include/Makefile.am 15 Feb 2005 20:55:20 -0000
@@ -27,9 +27,7 @@ $(top_srcdir)/include/gnu_xml_libxmlj_tr
$(top_srcdir)/include/gnu_xml_libxmlj_transform_GnomeTransformerFactory.h
GTKPEER_H_FILES = \
-$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkFontMetrics.h \
$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkFontPeer.h \
-$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkGlyphVector.h \
$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkGraphics.h \
$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkGraphics2D.h \
$(top_srcdir)/include/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h \
Index: include/gnu_java_awt_peer_gtk_GdkFontMetrics.h
===================================================================
RCS file: include/gnu_java_awt_peer_gtk_GdkFontMetrics.h
diff -N include/gnu_java_awt_peer_gtk_GdkFontMetrics.h
--- include/gnu_java_awt_peer_gtk_GdkFontMetrics.h 16 Jan 2005 02:14:46 -0000 1.6.2.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,42 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-
-#ifndef __gnu_java_awt_peer_gtk_GdkFontMetrics__
-#define __gnu_java_awt_peer_gtk_GdkFontMetrics__
-
-#include HORIZONTAL
or VERTICAL
constant
- * from this class.
- */
-private int orientation;
-
-/**
- * @serial The current value of this scrollbar.
- */
-private int value;
-
-/**
- * @serial The width of the scrollbar's thumb, which is relative
- * to the minimum and maximum value of the scrollbar.
- */
-private int visibleAmount;
-
-// List of AdjustmentListener's.
-private AdjustmentListener adjustment_listeners;
-
-private transient boolean valueIsAdjusting = false;
-
- /*
- * The number used to generate the name returned by getName.
- */
- private static transient long next_scrollbar_number;
-
-/*************************************************************************/
-
-/*
- * Constructors
+ * This class implements a scrollbar widget.
+ *
+ * @author Aaron M. Renn (address@hidden)
+ * @author Tom Tromey (address@hidden)
+ * @author Andrew John Hughes (address@hidden)
*/
-
-/**
- * Initializes a new instance of Scrollbar
with a
- * vertical orientation and default values for all other parameters.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- */
-public
-Scrollbar()
-{
- this(VERTICAL);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of Scrollbar
with the
- * specified orientation and default values for all other parameters.
- * The orientation must be either the constant HORIZONTAL
or
- * VERTICAL
from this class. An incorrect value will throw
- * an exception.
- *
- * @param orientation The orientation of this scrollbar.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- * @exception IllegalArgumentException If the orientation value is not valid.
- */
-public
-Scrollbar(int orientation) throws IllegalArgumentException
-{
- this(orientation, 0, 10, 0, 100);
-}
-
-/*************************************************************************/
-
-/**
- * Initializes a new instance of Scrollbar
with the
- * specified parameters. The orientation must be either the constant
- * HORIZONTAL
or VERTICAL
. An incorrect value
- * will throw an exception. Inconsistent values for other parameters
- * are silently corrected to valid values.
- *
- * @param orientation The orientation of this scrollbar.
- * @param value The initial value of the scrollbar.
- * @param visibleAmount The width of the scrollbar thumb.
- * @param minimum The minimum value of the scrollbar.
- * @param maximum The maximum value of the scrollbar.
- *
- * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
- * @exception IllegalArgumentException If the orientation value is not valid.
- */
-public
-Scrollbar(int orientation, int value, int visibleAmount, int minimum,
- int maximum) throws IllegalArgumentException
-{
- if (GraphicsEnvironment.isHeadless())
- throw new HeadlessException ();
-
- if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
- throw new IllegalArgumentException("Bad orientation value: "
- + orientation);
-
- this.orientation = orientation;
-
- setValues(value, visibleAmount, minimum, maximum);
-
- // Default is 1 according to online docs.
- lineIncrement = 1;
-
- // Default is 10 according to javadocs.
- pageIncrement = 10;
-}
-
-/*************************************************************************/
-
-/*
- * Instance Methods
- */
-
-/**
- * Returns the orientation constant for this object.
- *
- * @return The orientation constant for this object.
- */
-public int
-getOrientation()
-{
- return(orientation);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the orientation of this scrollbar to the specified value. This
- * value must be either the constant HORIZONTAL
or
- * VERTICAL
from this class or an exception will be thrown.
- *
- * @param orientation The new orientation value.
- *
- * @exception IllegalArgumentException If the orientation value is not valid.
- */
-public void
-setOrientation(int orientation)
-{
- if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
- throw new IllegalArgumentException("Bad orientation value: "
- + orientation);
-
- // FIXME: Communicate to peer? Or must this be called before peer creation?
- this.orientation = orientation;
-}
-
-/*************************************************************************/
-
-/**
- * Returns the current value for this scrollbar.
- *
- * @return The current value for this scrollbar.
- */
-public int
-getValue()
-{
- return(value);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the current value for this scrollbar to the specified value.
- * If this is inconsistent with the minimum and maximum values for this
- * scrollbar, the value is silently adjusted.
- *
- * @param value The new value for this scrollbar.
- */
-public void
-setValue(int value)
-{
- setValues(value, visibleAmount, minimum, maximum);
-}
-
-/*************************************************************************/
-
-/**
- * Returns the maximum value for this scrollbar.
- *
- * @return The maximum value for this scrollbar.
- */
-public int
-getMaximum()
-{
- return(maximum);
-}
-
-/*************************************************************************/
-
-/**
- * Sets the maximum value for this scrollbar to the specified value.
- * If the value is less than the current minimum value, it is silent
- * set to equal the minimum value.
- *
- * @param maximum The new maximum value for this scrollbar.
- */
-public void
-setMaximum(int maximum)
+public class Scrollbar extends Component implements Accessible, Adjustable
{
- setValues(value, visibleAmount, minimum, maximum);
-}
-
-/*************************************************************************/
+ // FIXME: Serialization readObject/writeObject
-/**
- * Returns the minimum value for this scrollbar.
- *
- * @return The minimum value for this scrollbar.
- */
-public int
-getMinimum()
-{
- return(minimum);
-}
+ /**
+ * Constant indicating that a scrollbar is horizontal.
+ */
+ public static final int HORIZONTAL = 0;
-/*************************************************************************/
+ /**
+ * Constant indicating that a scrollbar is vertical.
+ */
+ public static final int VERTICAL = 1;
-/**
- * Sets the minimum value for this scrollbar to the specified value. If
- * this is not consistent with the current value and maximum, it is
- * silently adjusted to be consistent.
- *
- * @param minimum The new minimum value for this scrollbar.
- */
-public void
-setMinimum(int minimum)
-{
- setValues(value, visibleAmount, minimum, maximum);
-}
+ /**
+ * Serialization Constant.
+ */
+ private static final long serialVersionUID = 8451667562882310543L;
-/*************************************************************************/
+ /**
+ * @serial The amount by which the value of the scrollbar is changed
+ * when incrementing in line mode.
+ */
+ private int lineIncrement;
-/**
- * Returns the width of the scrollbar's thumb, in units relative to the
- * maximum and minimum value of the scrollbar.
- *
- * @return The width of the scrollbar's thumb.
- */
-public int
-getVisibleAmount()
-{
- return getVisible ();
-}
+ /**
+ * @serial The amount by which the value of the scrollbar is changed
+ * when incrementing in page mode.
+ */
+ private int pageIncrement;
-/*************************************************************************/
+ /**
+ * @serial The maximum value for this scrollbar
+ */
+ private int maximum;
-/**
- * Returns the width of the scrollbar's thumb, in units relative to the
- * maximum and minimum value of the scrollbar.
- *
- * @return The width of the scrollbar's thumb.
- *
- * @deprecated This method is deprecated in favor of
- * getVisibleAmount()
.
- */
-public int
-getVisible()
-{
- return visibleAmount;
-}
+ /**
+ * @serial The minimum value for this scrollbar
+ */
+ private int minimum;
-/*************************************************************************/
+ /**
+ * @serial The orientation of this scrollbar, which will be either
+ * the HORIZONTAL
or VERTICAL
constant
+ * from this class.
+ */
+ private int orientation;
-/**
- * Sets the width of the scrollbar's thumb, in units relative to the
- * maximum and minimum value of the scrollbar.
- *
- * @param visibleAmount The new visible amount value of the scrollbar.
- */
-public void
-setVisibleAmount(int visibleAmount)
-{
- setValues(value, visibleAmount, minimum, maximum);
-}
+ /**
+ * @serial The current value of this scrollbar.
+ */
+ private int value;
-/*************************************************************************/
+ /**
+ * @serial The width of the scrollbar's thumb, which is relative
+ * to the minimum and maximum value of the scrollbar.
+ */
+ private int visibleAmount;
-/**
- * Sets the current value, visible amount, minimum, and maximum for this
- * scrollbar. These values are adjusted to be internally consistent
- * if necessary.
- *
- * @param value The new value for this scrollbar.
- * @param visibleAmount The new visible amount for this scrollbar.
- * @param minimum The new minimum value for this scrollbar.
- * @param maximum The new maximum value for this scrollbar.
- */
-public synchronized void
-setValues(int value, int visibleAmount, int minimum, int maximum)
-{
- if (maximum < minimum)
- maximum = minimum;
+ /**
+ * List of AdjustmentListener's.
+ */
+ private AdjustmentListener adjustment_listeners;
- if (value < minimum)
- value = minimum;
+ /**
+ * true if the scrollbar is adjusting, false otherwise.
+ */
+ private transient boolean valueIsAdjusting = false;
- if (value > maximum)
- value = maximum;
+ /**
+ * The number used to generate the name returned by getName.
+ */
+ private static transient long next_scrollbar_number;
- if (visibleAmount > maximum - minimum)
- visibleAmount = maximum - minimum;
-
- ScrollbarPeer peer = (ScrollbarPeer) getPeer ();
- if (peer != null
- && (this.value != value || this.visibleAmount != visibleAmount
- || this.minimum != minimum || this.maximum != maximum))
- peer.setValues(value, visibleAmount, minimum, maximum);
-
- this.value = value;
- this.visibleAmount = visibleAmount;
- this.minimum = minimum;
- this.maximum = maximum;
+ /**
+ * Initializes a new instance of Scrollbar
with a
+ * vertical orientation and default values for all other parameters.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
+ */
+ public Scrollbar()
+ {
+ this(VERTICAL);
+ }
- int range = maximum - minimum;
- if (lineIncrement > range)
- {
- if (range == 0)
- lineIncrement = 1;
- else
- lineIncrement = range;
+ /**
+ * Initializes a new instance of Scrollbar
with the
+ * specified orientation and default values for all other parameters.
+ * The orientation must be either the constant HORIZONTAL
or
+ * VERTICAL
from this class. An incorrect value will throw
+ * an exception.
+ *
+ * @param orientation The orientation of this scrollbar.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
+ * @exception IllegalArgumentException If the orientation value is not valid.
+ */
+ public Scrollbar(int orientation) throws IllegalArgumentException
+ {
+ this(orientation, 0, 10, 0, 100);
+ }
- if (peer != null)
- peer.setLineIncrement(lineIncrement);
- }
+ /**
+ * Initializes a new instance of Scrollbar
with the
+ * specified parameters. The orientation must be either the constant
+ * HORIZONTAL
or VERTICAL
. An incorrect value
+ * will throw an exception. Inconsistent values for other parameters
+ * are silently corrected to valid values.
+ *
+ * @param orientation The orientation of this scrollbar.
+ * @param value The initial value of the scrollbar.
+ * @param visibleAmount The width of the scrollbar thumb.
+ * @param minimum The minimum value of the scrollbar.
+ * @param maximum The maximum value of the scrollbar.
+ *
+ * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true,
+ * @exception IllegalArgumentException If the orientation value is not valid.
+ */
+ public Scrollbar(int orientation, int value, int visibleAmount, int minimum,
+ int maximum) throws IllegalArgumentException
+ {
+ if (GraphicsEnvironment.isHeadless())
+ throw new HeadlessException();
- if (pageIncrement > range)
- {
- if (range == 0)
- pageIncrement = 1;
- else
- pageIncrement = range;
+ if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
+ throw new IllegalArgumentException("Bad orientation value: "
+ + orientation);
- if (peer != null)
- peer.setPageIncrement(pageIncrement);
- }
-}
+ this.orientation = orientation;
-/*************************************************************************/
+ setValues(value, visibleAmount, minimum, maximum);
-/**
- * Returns the value added or subtracted when the user activates the scrollbar
- * scroll by a "unit" amount.
- *
- * @return The unit increment value.
- */
-public int
-getUnitIncrement()
-{
- return getLineIncrement ();
-}
+ // Default is 1 according to online docs.
+ lineIncrement = 1;
-/*************************************************************************/
+ // Default is 10 according to javadocs.
+ pageIncrement = 10;
+ }
-/**
- * Returns the value added or subtracted when the user selects the scrollbar
- * scroll by a "unit" amount control.
- *
- * @return The unit increment value.
- *
- * @deprecated This method is deprecated in favor of
- * getUnitIncrement()
.
- */
-public int
-getLineIncrement()
-{
- return lineIncrement;
-}
+ /**
+ * Returns the orientation constant for this object.
+ *
+ * @return The orientation constant for this object.
+ */
+ public int getOrientation()
+ {
+ return orientation;
+ }
-/*************************************************************************/
+ /**
+ * Sets the orientation of this scrollbar to the specified value. This
+ * value must be either the constant HORIZONTAL
or
+ * VERTICAL
from this class or an exception will be thrown.
+ *
+ * @param orientation The new orientation value.
+ *
+ * @exception IllegalArgumentException If the orientation value is not valid.
+ */
+ public void setOrientation(int orientation)
+ {
+ if ((orientation != HORIZONTAL) && (orientation != VERTICAL))
+ throw new IllegalArgumentException("Bad orientation value: "
+ + orientation);
-/**
- * Sets the value added or subtracted to the scrollbar value when the
- * user selects the scroll by a "unit" amount control.
- *
- * @param unitIncrement The new unit increment amount.
- */
-public synchronized void
-setUnitIncrement(int unitIncrement)
-{
- setLineIncrement (unitIncrement);
-}
+ // FIXME: Communicate to peer? Or must this be called before peer creation?
+ this.orientation = orientation;
+ }
-/*************************************************************************/
+ /**
+ * Returns the current value for this scrollbar.
+ *
+ * @return The current value for this scrollbar.
+ */
+ public int getValue()
+ {
+ return value;
+ }
-/**
- * Sets the value added or subtracted to the scrollbar value when the
- * user selects the scroll by a "unit" amount control.
- *
- * @param lineIncrement The new unit increment amount.
- *
- * @deprecated This method is deprecated in favor of
- * setUnitIncrement()
.
- */
-public void
-setLineIncrement(int lineIncrement)
-{
- if (lineIncrement < 0)
- throw new IllegalArgumentException ("Unit increment less than zero.");
+ /**
+ * Sets the current value for this scrollbar to the specified value.
+ * If this is inconsistent with the minimum and maximum values for this
+ * scrollbar, the value is silently adjusted.
+ *
+ * @param value The new value for this scrollbar.
+ */
+ public void setValue(int value)
+ {
+ setValues(value, visibleAmount, minimum, maximum);
+ }
- int range = maximum - minimum;
- if (lineIncrement > range)
- {
- if (range == 0)
- lineIncrement = 1;
- else
- lineIncrement = range;
- }
+ /**
+ * Returns the maximum value for this scrollbar.
+ *
+ * @return The maximum value for this scrollbar.
+ */
+ public int getMaximum()
+ {
+ return maximum;
+ }
- if (lineIncrement == this.lineIncrement)
- return;
+ /**
+ * Sets the maximum value for this scrollbar to the specified value.
+ * If the value is less than the current minimum value, it is silent
+ * set to equal the minimum value.
+ *
+ * @param maximum The new maximum value for this scrollbar.
+ */
+ public void setMaximum(int maximum)
+ {
+ setValues(value, visibleAmount, minimum, maximum);
+ }
- this.lineIncrement = lineIncrement;
+ /**
+ * Returns the minimum value for this scrollbar.
+ *
+ * @return The minimum value for this scrollbar.
+ */
+ public int getMinimum()
+ {
+ return minimum;
+ }
- ScrollbarPeer peer = (ScrollbarPeer) getPeer ();
- if (peer != null)
- peer.setLineIncrement (this.lineIncrement);
-}
+ /**
+ * Sets the minimum value for this scrollbar to the specified value. If
+ * this is not consistent with the current value and maximum, it is
+ * silently adjusted to be consistent.
+ *
+ * @param minimum The new minimum value for this scrollbar.
+ */
+ public void setMinimum(int minimum)
+ {
+ setValues(value, visibleAmount, minimum, maximum);
+ }
-/*************************************************************************/
+ /**
+ * Returns the width of the scrollbar's thumb, in units relative to the
+ * maximum and minimum value of the scrollbar.
+ *
+ * @return The width of the scrollbar's thumb.
+ */
+ public int getVisibleAmount()
+ {
+ return getVisible();
+ }
-/**
- * Returns the value added or subtracted when the user activates the scrollbar
- * scroll by a "block" amount.
- *
- * @return The block increment value.
- */
-public int
-getBlockIncrement()
-{
- return getPageIncrement ();
-}
+ /**
+ * Returns the width of the scrollbar's thumb, in units relative to the
+ * maximum and minimum value of the scrollbar.
+ *
+ * @return The width of the scrollbar's thumb.
+ *
+ * @deprecated This method is deprecated in favor of
+ * getVisibleAmount()
.
+ */
+ public int getVisible()
+ {
+ return visibleAmount;
+ }
-/*************************************************************************/
+ /**
+ * Sets the width of the scrollbar's thumb, in units relative to the
+ * maximum and minimum value of the scrollbar.
+ *
+ * @param visibleAmount The new visible amount value of the scrollbar.
+ */
+ public void setVisibleAmount(int visibleAmount)
+ {
+ setValues(value, visibleAmount, minimum, maximum);
+ }
-/**
- * Returns the value added or subtracted when the user selects the scrollbar
- * scroll by a "block" amount control.
- *
- * @return The block increment value.
- *
- * @deprecated This method is deprecated in favor of
- * getBlockIncrement()
.
- */
-public int
-getPageIncrement()
-{
- return pageIncrement;
-}
+ /**
+ * Sets the current value, visible amount, minimum, and maximum for this
+ * scrollbar. These values are adjusted to be internally consistent
+ * if necessary.
+ *
+ * @param value The new value for this scrollbar.
+ * @param visibleAmount The new visible amount for this scrollbar.
+ * @param minimum The new minimum value for this scrollbar.
+ * @param maximum The new maximum value for this scrollbar.
+ */
+ public synchronized void setValues(int value, int visibleAmount,
+ int minimum, int maximum)
+ {
+ if (maximum < minimum)
+ maximum = minimum;
-/*************************************************************************/
+ if (value < minimum)
+ value = minimum;
-/**
- * Sets the value added or subtracted to the scrollbar value when the
- * user selects the scroll by a "block" amount control.
- *
- * @param blockIncrement The new block increment amount.
- */
-public synchronized void
-setBlockIncrement(int blockIncrement)
-{
- setPageIncrement (blockIncrement);
-}
+ if (value > maximum)
+ value = maximum;
-/*************************************************************************/
+ if (visibleAmount > maximum - minimum)
+ visibleAmount = maximum - minimum;
+
+ ScrollbarPeer peer = (ScrollbarPeer) getPeer();
+ if (peer != null
+ && (this.value != value || this.visibleAmount != visibleAmount
+ || this.minimum != minimum || this.maximum != maximum))
+ peer.setValues(value, visibleAmount, minimum, maximum);
+
+ this.value = value;
+ this.visibleAmount = visibleAmount;
+ this.minimum = minimum;
+ this.maximum = maximum;
+
+ int range = maximum - minimum;
+ if (lineIncrement > range)
+ {
+ if (range == 0)
+ lineIncrement = 1;
+ else
+ lineIncrement = range;
+
+ if (peer != null)
+ peer.setLineIncrement(lineIncrement);
+ }
+
+ if (pageIncrement > range)
+ {
+ if (range == 0)
+ pageIncrement = 1;
+ else
+ pageIncrement = range;
+
+ if (peer != null)
+ peer.setPageIncrement(pageIncrement);
+ }
+ }
-/**
- * Sets the value added or subtracted to the scrollbar value when the
- * user selects the scroll by a "block" amount control.
- *
- * @param pageIncrement The new block increment amount.
- *
- * @deprecated This method is deprecated in favor of
- * setBlockIncrement()
.
- */
-public void
-setPageIncrement(int pageIncrement)
-{
- if (pageIncrement < 0)
- throw new IllegalArgumentException ("Block increment less than zero.");
+ /**
+ * Returns the value added or subtracted when the user activates the scrollbar
+ * scroll by a "unit" amount.
+ *
+ * @return The unit increment value.
+ */
+ public int getUnitIncrement()
+ {
+ return getLineIncrement();
+ }
- int range = maximum - minimum;
- if (pageIncrement > range)
- {
- if (range == 0)
- pageIncrement = 1;
- else
- pageIncrement = range;
- }
+ /**
+ * Returns the value added or subtracted when the user selects the scrollbar
+ * scroll by a "unit" amount control.
+ *
+ * @return The unit increment value.
+ *
+ * @deprecated This method is deprecated in favor of
+ * getUnitIncrement()
.
+ */
+ public int getLineIncrement()
+ {
+ return lineIncrement;
+ }
- if (pageIncrement == this.pageIncrement)
- return;
+ /**
+ * Sets the value added or subtracted to the scrollbar value when the
+ * user selects the scroll by a "unit" amount control.
+ *
+ * @param unitIncrement The new unit increment amount.
+ */
+ public synchronized void setUnitIncrement(int unitIncrement)
+ {
+ setLineIncrement(unitIncrement);
+ }
- this.pageIncrement = pageIncrement;
+ /**
+ * Sets the value added or subtracted to the scrollbar value when the
+ * user selects the scroll by a "unit" amount control.
+ *
+ * @param lineIncrement The new unit increment amount.
+ *
+ * @deprecated This method is deprecated in favor of
+ * setUnitIncrement()
.
+ */
+ public void setLineIncrement(int lineIncrement)
+ {
+ if (lineIncrement < 0)
+ throw new IllegalArgumentException("Unit increment less than zero.");
- ScrollbarPeer peer = (ScrollbarPeer) getPeer ();
- if (peer != null)
- peer.setPageIncrement (this.pageIncrement);
-}
+ int range = maximum - minimum;
+ if (lineIncrement > range)
+ {
+ if (range == 0)
+ lineIncrement = 1;
+ else
+ lineIncrement = range;
+ }
+
+ if (lineIncrement == this.lineIncrement)
+ return;
+
+ this.lineIncrement = lineIncrement;
+
+ ScrollbarPeer peer = (ScrollbarPeer) getPeer();
+ if (peer != null)
+ peer.setLineIncrement(this.lineIncrement);
+ }
-/*************************************************************************/
+ /**
+ * Returns the value added or subtracted when the user activates the scrollbar
+ * scroll by a "block" amount.
+ *
+ * @return The block increment value.
+ */
+ public int getBlockIncrement()
+ {
+ return getPageIncrement();
+ }
-/**
- * Notifies this object to create its native peer.
- */
-public synchronized void
-addNotify()
-{
- if (peer == null)
- peer = getToolkit ().createScrollbar (this);
- super.addNotify ();
-}
+ /**
+ * Returns the value added or subtracted when the user selects the scrollbar
+ * scroll by a "block" amount control.
+ *
+ * @return The block increment value.
+ *
+ * @deprecated This method is deprecated in favor of
+ * getBlockIncrement()
.
+ */
+ public int getPageIncrement()
+ {
+ return pageIncrement;
+ }
-/*************************************************************************/
+ /**
+ * Sets the value added or subtracted to the scrollbar value when the
+ * user selects the scroll by a "block" amount control.
+ *
+ * @param blockIncrement The new block increment amount.
+ */
+ public synchronized void setBlockIncrement(int blockIncrement)
+ {
+ setPageIncrement(blockIncrement);
+ }
-/**
- * Adds a new adjustment listener to the list of registered listeners
- * for this object.
- *
- * @param listener The listener to add.
- */
-public synchronized void
-addAdjustmentListener(AdjustmentListener listener)
-{
- adjustment_listeners = AWTEventMulticaster.add(adjustment_listeners, listener);
- enableEvents(AWTEvent.ADJUSTMENT_EVENT_MASK);
-}
+ /**
+ * Sets the value added or subtracted to the scrollbar value when the
+ * user selects the scroll by a "block" amount control.
+ *
+ * @param pageIncrement The new block increment amount.
+ *
+ * @deprecated This method is deprecated in favor of
+ * setBlockIncrement()
.
+ */
+ public void setPageIncrement(int pageIncrement)
+ {
+ if (pageIncrement < 0)
+ throw new IllegalArgumentException("Block increment less than zero.");
-/*************************************************************************/
+ int range = maximum - minimum;
+ if (pageIncrement > range)
+ {
+ if (range == 0)
+ pageIncrement = 1;
+ else
+ pageIncrement = range;
+ }
+
+ if (pageIncrement == this.pageIncrement)
+ return;
+
+ this.pageIncrement = pageIncrement;
+
+ ScrollbarPeer peer = (ScrollbarPeer) getPeer();
+ if (peer != null)
+ peer.setPageIncrement(this.pageIncrement);
+ }
-/**
- * Removes the specified listener from the list of registered listeners
- * for this object.
- *
- * @param listener The listener to remove.
- */
-public synchronized void
-removeAdjustmentListener(AdjustmentListener listener)
-{
- adjustment_listeners = AWTEventMulticaster.remove(adjustment_listeners,
- listener);
-}
+ /**
+ * Notifies this object to create its native peer.
+ */
+ public synchronized void addNotify()
+ {
+ if (peer == null)
+ peer = getToolkit().createScrollbar(this);
+ super.addNotify();
+ }
-/*************************************************************************/
+ /**
+ * Adds a new adjustment listener to the list of registered listeners
+ * for this object.
+ *
+ * @param listener The listener to add.
+ */
+ public synchronized void addAdjustmentListener(AdjustmentListener listener)
+ {
+ adjustment_listeners = AWTEventMulticaster.add(adjustment_listeners,
+ listener);
+ enableEvents(AWTEvent.ADJUSTMENT_EVENT_MASK);
+ }
-/**
- * Processes events for this scrollbar. It does this by calling
- * processAdjustmentEvent()
if the event is an instance of
- * AdjustmentEvent
, otherwise it calls the superclass to
- * process the event.
- *
- * @param event The event to process.
- */
-protected void
-processEvent(AWTEvent event)
-{
- if (event instanceof AdjustmentEvent)
- processAdjustmentEvent((AdjustmentEvent)event);
- else
- super.processEvent(event);
-}
+ /**
+ * Removes the specified listener from the list of registered listeners
+ * for this object.
+ *
+ * @param listener The listener to remove.
+ */
+ public synchronized void removeAdjustmentListener(AdjustmentListener listener)
+ {
+ adjustment_listeners = AWTEventMulticaster.remove(adjustment_listeners,
+ listener);
+ }
-/*************************************************************************/
+ /**
+ * Processes events for this scrollbar. It does this by calling
+ * processAdjustmentEvent()
if the event is an instance of
+ * AdjustmentEvent
, otherwise it calls the superclass to
+ * process the event.
+ *
+ * @param event The event to process.
+ */
+ protected void processEvent(AWTEvent event)
+ {
+ if (event instanceof AdjustmentEvent)
+ processAdjustmentEvent((AdjustmentEvent) event);
+ else
+ super.processEvent(event);
+ }
-/**
- * Processes adjustment events for this object by dispatching them to
- * any registered listeners. Note that this method will only be called
- * if adjustment events are enabled. This will happen automatically if
- * any listeners are registered. Otherwise, it can be enabled by a
- * call to enableEvents()
.
- *
- * @param event The event to process.
- */
-protected void
-processAdjustmentEvent(AdjustmentEvent event)
-{
- value = event.getValue();
- if (adjustment_listeners != null)
- adjustment_listeners.adjustmentValueChanged(event);
-}
+ /**
+ * Processes adjustment events for this object by dispatching them to
+ * any registered listeners. Note that this method will only be called
+ * if adjustment events are enabled. This will happen automatically if
+ * any listeners are registered. Otherwise, it can be enabled by a
+ * call to enableEvents()
.
+ *
+ * @param event The event to process.
+ */
+ protected void processAdjustmentEvent(AdjustmentEvent event)
+ {
+ value = event.getValue();
+ if (adjustment_listeners != null)
+ adjustment_listeners.adjustmentValueChanged(event);
+ }
-void
-dispatchEventImpl(AWTEvent e)
-{
- if (e.id <= AdjustmentEvent.ADJUSTMENT_LAST
+ void dispatchEventImpl(AWTEvent e)
+ {
+ if (e.id <= AdjustmentEvent.ADJUSTMENT_LAST
&& e.id >= AdjustmentEvent.ADJUSTMENT_FIRST
&& (adjustment_listeners != null
|| (eventMask & AWTEvent.ADJUSTMENT_EVENT_MASK) != 0))
- processEvent(e);
- else
- super.dispatchEventImpl(e);
-}
-
-/*************************************************************************/
+ processEvent(e);
+ else
+ super.dispatchEventImpl(e);
+ }
-/**
- * Returns a debugging string for this object.
- *
- * @return A debugging string for this object.
- */
-protected String
-paramString()
-{
- return("value=" + getValue() + ",visibleAmount=" +
- getVisibleAmount() + ",minimum=" + getMinimum()
- + ",maximum=" + getMaximum()
- + ",pageIncrement=" + pageIncrement
- + ",lineIncrement=" + lineIncrement
- + ",orientation=" + (orientation == HORIZONTAL
- ? "HORIZONTAL" : "VERTICAL")
- + super.paramString());
-}
+ /**
+ * Returns a debugging string for this object.
+ *
+ * @return A debugging string for this object.
+ */
+ protected String paramString()
+ {
+ return ("value=" + getValue() + ",visibleAmount=" + getVisibleAmount()
+ + ",minimum=" + getMinimum() + ",maximum=" + getMaximum()
+ + ",pageIncrement=" + pageIncrement + ",lineIncrement="
+ + lineIncrement + ",orientation="
+ + (orientation == HORIZONTAL ? "HORIZONTAL" : "VERTICAL")
+ + super.paramString());
+ }
/**
* Returns an array of all the objects currently registered as FooListeners
- * upon this Scrollbar
. FooListeners are registered using the
+ * upon this Scrollbar
. FooListeners are registered using the
* addFooListener method.
*
* @exception ClassCastException If listenerType doesn't specify a class or
* interface that implements java.util.EventListener.
*/
- public EventListener[] getListeners (Class listenerType)
+ public EventListener[] getListeners(Class listenerType)
{
if (listenerType == AdjustmentListener.class)
- return AWTEventMulticaster.getListeners (adjustment_listeners,
- listenerType);
+ return AWTEventMulticaster.getListeners(adjustment_listeners,
+ listenerType);
- return super.getListeners (listenerType);
+ return super.getListeners(listenerType);
}
/**
* Returns an array of all registered adjustment listeners.
*/
- public AdjustmentListener[] getAdjustmentListeners ()
+ public AdjustmentListener[] getAdjustmentListeners()
{
- return (AdjustmentListener[]) getListeners (AdjustmentListener.class);
+ return (AdjustmentListener[]) getListeners(AdjustmentListener.class);
}
/**
@@ -746,7 +649,7 @@ paramString()
*
* @since 1.4
*/
- public boolean getValueIsAdjusting ()
+ public boolean getValueIsAdjusting()
{
return valueIsAdjusting;
}
@@ -756,7 +659,7 @@ paramString()
*
* @since 1.4
*/
- public void setValueIsAdjusting (boolean valueIsAdjusting)
+ public void setValueIsAdjusting(boolean valueIsAdjusting)
{
this.valueIsAdjusting = valueIsAdjusting;
}
@@ -766,16 +669,16 @@ paramString()
*
* @return A unique name for this scroll bar.
*/
- String generateName ()
+ String generateName()
{
- return "scrollbar" + getUniqueLong ();
+ return "scrollbar" + getUniqueLong();
}
- private static synchronized long getUniqueLong ()
+ private static synchronized long getUniqueLong()
{
return next_scrollbar_number++;
}
-
+
/**
* This class provides accessibility support for the
* scrollbar.
@@ -784,9 +687,8 @@ paramString()
* @author Andrew John Hughes (address@hidden)
*/
protected class AccessibleAWTScrollBar extends AccessibleAWTComponent
- implements AccessibleValue
+ implements AccessibleValue
{
-
/**
* Serialization constant to match JDK 1.5
*/
@@ -796,20 +698,21 @@ paramString()
* Returns the role of this accessible object.
*
* @return the instance of AccessibleRole
,
- * which describes this object.
+ * which describes this object.
+ *
* @see javax.accessibility.AccessibleRole
*/
public AccessibleRole getAccessibleRole()
{
return AccessibleRole.SCROLL_BAR;
}
-
+
/**
* Returns the state set of this accessible object.
*
- * @return a set of AccessibleState
s
- * which represent the current state of the
- * accessible object.
+ * @return a set of AccessibleState
s which
+ * represent the current state of the accessible object.
+ *
* @see javax.accessibility.AccessibleState
* @see javax.accessibility.AccessibleStateSet
*/
@@ -817,14 +720,14 @@ paramString()
{
AccessibleStateSet states = super.getAccessibleStateSet();
if (getOrientation() == HORIZONTAL)
- states.add(AccessibleState.HORIZONTAL);
+ states.add(AccessibleState.HORIZONTAL);
else
- states.add(AccessibleState.VERTICAL);
+ states.add(AccessibleState.VERTICAL);
if (getValueIsAdjusting())
- states.add(AccessibleState.BUSY);
+ states.add(AccessibleState.BUSY);
return states;
}
-
+
/**
* Returns an implementation of the AccessibleValue
* interface for this accessible object. In this case, the
@@ -833,6 +736,7 @@ paramString()
* the context.
*
* @return the accessible value associated with this context.
+ *
* @see javax.accessibility.AccessibleValue
*/
public AccessibleValue getAccessibleValue()
@@ -847,6 +751,7 @@ paramString()
* object.
*
* @return the numeric value of this scrollbar.
+ *
* @see javax.accessibility.AccessibleValue#getCurrentAccessibleValue()
*/
public Number getCurrentAccessibleValue()
@@ -861,7 +766,9 @@ paramString()
* true.
*
* @param number the new accessible value.
+ *
* @return true if the value was set.
+ *
* @see javax.accessibility.AccessibleValue#setCurrentAccessibleValue(java.lang.Number)
*/
public boolean setCurrentAccessibleValue(Number number)
@@ -877,6 +784,7 @@ paramString()
* object.
*
* @return the minimum value of this scrollbar.
+ *
* @see javax.accessibility.AccessibleValue#getMinimumAccessibleValue()
*/
public Number getMinimumAccessibleValue()
@@ -891,6 +799,7 @@ paramString()
* object.
*
* @return the maximum value of this scrollbar.
+ *
* @see javax.accessibility.AccessibleValue#getMaximumAccessibleValue()
*/
public Number getMaximumAccessibleValue()
@@ -898,7 +807,7 @@ paramString()
return new Integer(getMaximum());
}
}
-
+
/**
* Gets the AccessibleContext associated with this Scrollbar
.
* The context is created, if necessary.
@@ -910,8 +819,7 @@ paramString()
/* Create the context if this is the first request */
if (accessibleContext == null)
accessibleContext = new AccessibleAWTScrollBar();
+
return accessibleContext;
}
-
-} // class Scrollbar
-
+}
Index: java/beans/XMLDecoder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/beans/XMLDecoder.java,v
retrieving revision 1.2.2.1
diff -u -3 -p -u -r1.2.2.1 XMLDecoder.java
--- java/beans/XMLDecoder.java 16 Jan 2005 15:15:11 -0000 1.2.2.1
+++ java/beans/XMLDecoder.java 15 Feb 2005 20:55:21 -0000
@@ -38,7 +38,6 @@ exception statement from your version. *
package java.beans;
-import gnu.java.beans.decoder.DecoderContext;
import gnu.java.beans.decoder.DefaultExceptionListener;
import gnu.java.beans.decoder.PersistenceParser;
Index: java/io/ObjectInputStream.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/io/ObjectInputStream.java,v
retrieving revision 1.43.2.7
diff -u -3 -p -u -r1.43.2.7 ObjectInputStream.java
--- java/io/ObjectInputStream.java 4 Feb 2005 09:44:44 -0000 1.43.2.7
+++ java/io/ObjectInputStream.java 15 Feb 2005 20:55:21 -0000
@@ -773,8 +773,6 @@ public class ObjectInputStream extends I
return Float.TYPE;
if (name.equals("double"))
return Double.TYPE;
- if (name.equals("void"))
- return Void.TYPE;
throw cnfe;
}
Index: java/net/URI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URI.java,v
retrieving revision 1.6.2.3
diff -u -3 -p -u -r1.6.2.3 URI.java
--- java/net/URI.java 18 Jan 2005 11:38:30 -0000 1.6.2.3
+++ java/net/URI.java 15 Feb 2005 20:55:22 -0000
@@ -65,7 +65,7 @@ public final class URI implements Compar
"^(([^:/?#]+):)?((//([^/?#]*))?([^?#]*)(\\?([^#]*))?)?(#(.*))?";
private static final String AUTHORITY_REGEXP =
- "^(([^?#]*)@([^?#]*):([^?#]*))?";
+ "^((([^?#]*)@)?([^?#:]*)(:([^?#]*)))?";
/**
* Valid characters (taken from rfc2396)
@@ -115,9 +115,9 @@ public final class URI implements Compar
*/
private static final int FRAGMENT_GROUP = 10;
- private static final int AUTHORITY_USERINFO_GROUP = 2;
- private static final int AUTHORITY_HOST_GROUP = 3;
- private static final int AUTHORITY_PORT_GROUP = 4;
+ private static final int AUTHORITY_USERINFO_GROUP = 3;
+ private static final int AUTHORITY_HOST_GROUP = 4;
+ private static final int AUTHORITY_PORT_GROUP = 6;
private transient String scheme;
private transient String rawSchemeSpecificPart;
Index: java/text/Collator.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/text/Collator.java,v
retrieving revision 1.11
diff -u -3 -p -u -r1.11 Collator.java
--- java/text/Collator.java 15 Jun 2004 22:40:39 -0000 1.11
+++ java/text/Collator.java 15 Feb 2005 20:55:22 -0000
@@ -308,7 +308,8 @@ public abstract class Collator implement
}
catch (MissingResourceException x)
{
- return null;
+ pattern = "<0<1<2<3<4<5<6<7<8<9 11)
+ {
+ year += (month / 12);
+ month = month % 12;
+ }
+
+ if (month < 0)
+ {
+ year += (int) month / 12;
+ month = month % 12;
+ if (month < 0)
+ {
+ month += 12;
+ year--;
+ }
+ }
+
+ int dayOfYear = dayCount[month] + 1;
if (month > 1)
if (isLeapYear(year))
dayOfYear++;
@@ -508,22 +525,28 @@ public class GregorianCalendar extends C
if (! isLenient())
nonLeniencyCheck();
- if (! isSet[MONTH])
+ if (! isSet[MONTH] && (! isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]))
{
// 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR
- if (isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR])
+ if (isSet[WEEK_OF_YEAR])
{
int first = getFirstDayOfMonth(year, 0);
- int offs;
- if ((8 - first) >= getMinimalDaysInFirstWeek())
- // start counting on first week
- offs = 1;
- else
- offs = 1 + (8 - first);
+ int offs = 1;
+ int daysInFirstWeek = getFirstDayOfWeek() - first;
+ if (daysInFirstWeek <= 0)
+ daysInFirstWeek += 7;
+ if (daysInFirstWeek < getMinimalDaysInFirstWeek())
+ offs += daysInFirstWeek;
+ else
+ offs -= 7 - daysInFirstWeek;
month = 0;
day = offs + 7 * (fields[WEEK_OF_YEAR] - 1);
- day += fields[DAY_OF_WEEK] - first;
+ offs = fields[DAY_OF_WEEK] - getFirstDayOfWeek();
+
+ if (offs < 0)
+ offs += 7;
+ day += offs;
}
else
{
@@ -549,8 +572,21 @@ public class GregorianCalendar extends C
}
else
{ // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
- day = 1 + 7 * (fields[WEEK_OF_MONTH] - 1);
- day += fields[DAY_OF_WEEK] - first;
+ int offs = 1;
+ int daysInFirstWeek = getFirstDayOfWeek() - first;
+ if (daysInFirstWeek <= 0)
+ daysInFirstWeek += 7;
+
+ if (daysInFirstWeek < getMinimalDaysInFirstWeek())
+ offs += daysInFirstWeek;
+ else
+ offs -= 7 - daysInFirstWeek;
+
+ day = offs + 7 * (fields[WEEK_OF_MONTH] - 1);
+ offs = fields[DAY_OF_WEEK] - getFirstDayOfWeek();
+ if (offs < 0)
+ offs += 7;
+ day += offs;
}
}
Index: java/util/ResourceBundle.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/ResourceBundle.java,v
retrieving revision 1.24.2.3
diff -u -3 -p -u -r1.24.2.3 ResourceBundle.java
--- java/util/ResourceBundle.java 16 Jan 2005 15:15:12 -0000 1.24.2.3
+++ java/util/ResourceBundle.java 15 Feb 2005 20:55:23 -0000
@@ -173,9 +173,11 @@ public abstract class ResourceBundle
if (o != null)
return o;
}
-
- throw new MissingResourceException("Key not found", getClass().getName(),
- key);
+
+ String className = getClass().getName();
+ throw new MissingResourceException("Key '" + key
+ + "'not found in Bundle: "
+ + className, className, key);
}
/**
@@ -491,7 +493,7 @@ public abstract class ResourceBundle
catch (IOException ex)
{
MissingResourceException mre = new MissingResourceException
- ("Failed to load bundle", localizedName, "");
+ ("Failed to load bundle: " + localizedName, localizedName, "");
mre.initCause(ex);
throw mre;
}
Index: java/util/TreeMap.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/TreeMap.java,v
retrieving revision 1.23.2.4
diff -u -3 -p -u -r1.23.2.4 TreeMap.java
--- java/util/TreeMap.java 15 Jan 2005 17:02:16 -0000 1.23.2.4
+++ java/util/TreeMap.java 15 Feb 2005 20:55:23 -0000
@@ -729,7 +729,7 @@ public class TreeMapgetAWTKeyStroke()
.
+ * But it returns null instead of throwing
+ * IllegalArugmentException
when
+ * the keystoke sequence cannot be parsed from the given string.
+ */
public static KeyStroke getKeyStroke(String str)
{
- return (KeyStroke) getAWTKeyStroke(str);
+ try
+ {
+ return (KeyStroke) getAWTKeyStroke(str);
+ }
+ catch (IllegalArgumentException iae)
+ {
+ return null;
+ }
}
public static KeyStroke getKeyStrokeForEvent(KeyEvent event)
Index: javax/swing/SortingFocusTraversalPolicy.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/SortingFocusTraversalPolicy.java,v
retrieving revision 1.1.2.2
diff -u -3 -p -u -r1.1.2.2 SortingFocusTraversalPolicy.java
--- javax/swing/SortingFocusTraversalPolicy.java 6 Feb 2005 02:24:18 -0000 1.1.2.2
+++ javax/swing/SortingFocusTraversalPolicy.java 15 Feb 2005 20:55:25 -0000
@@ -40,7 +40,6 @@ package javax.swing;
import java.awt.Component;
import java.awt.Container;
-import java.awt.FocusTraversalPolicy;
import java.util.Comparator;
import java.util.Iterator;
import java.util.TreeSet;
Index: javax/swing/SpinnerDateModel.java
===================================================================
RCS file: javax/swing/SpinnerDateModel.java
diff -N javax/swing/SpinnerDateModel.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ javax/swing/SpinnerDateModel.java 15 Feb 2005 20:55:25 -0000
@@ -0,0 +1,237 @@
+/* SpinnerDateModel.java --
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * SpinnerDateModel
+ *
+ * Implements a SpinnerModel for dates, rotating a calendar field such as
+ * month, year, day, week, hour, minute.
+ *
+ * @author Sven de Marothy
+ * @version 0.1 (first implementation)
+ */
+public class SpinnerDateModel extends AbstractSpinnerModel
+ implements Serializable
+{
+ private Calendar date;
+ private Comparable start;
+ private Comparable end;
+ private int calendarField;
+
+ /**
+ * For compatability with Sun's JDK
+ * FIXME: what's the number? And which fields should be serialized?
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Constructs a SpinnerDateModel using the current date,
+ * no start or end limit, and Calendar.DAY_OF_MONTH as the calendar field.
+ */
+ public SpinnerDateModel()
+ {
+ this(new Date(), null, null, Calendar.DAY_OF_MONTH);
+ }
+
+ /**
+ * Constructs a SpinnerDateModel which spins a given calendar field,
+ * using a given date and start and end date limits.
+ * @param value - the initial Date value
+ * @param start - start limit, as a Date object, or null
+ * for no lower limit.
+ * @param end - end limit, or null
for no upper limit.
+ * @param calendarField - the Calendar
field to spin,
+ * (Calendar.ZONE_OFFSET and Calendar.DST_OFFSET are invalid)
+ */
+ public SpinnerDateModel(Date value, Comparable start, Comparable end,
+ int calendarField)
+ {
+ date = Calendar.getInstance();
+ date.setTime(value);
+ this.start = start;
+ this.end = end;
+ setCalendarField(calendarField);
+ }
+
+ /**
+ * Returns the value of the Calendar field to spin.
+ */
+ public int getCalendarField()
+ {
+ return calendarField;
+ }
+
+ /**
+ * Returns the current date in the sequence.
+ * @return a Date
object.
+ */
+ public Date getDate()
+ {
+ return date.getTime();
+ }
+
+ /**
+ * Returns the starting limit of the SpinnerModel.
+ * @return a Date object, or null
if there is no limit.
+ */
+ public Comparable getStart()
+ {
+ return start;
+ }
+
+ /**
+ * Returns the end limit of the SpinnerModel.
+ * @return a Date object, or null
if there is no limit.
+ */
+ public Comparable getEnd()
+ {
+ return end;
+ }
+
+ /**
+ * Returns the current date in the sequence,
+ * this method returns the same as getDate()
.
+ * @return a Date
object.
+ */
+ public Object getValue()
+ {
+ return date.getTime();
+ }
+
+ /**
+ * Returns the next date in the sequence, or null
if the
+ * next date is equal to or past the end limit.
+ * @return a Date object, or null
.
+ */
+ public Object getNextValue()
+ {
+ Calendar nextCal = Calendar.getInstance();
+ nextCal.setTime(date.getTime());
+ nextCal.roll(calendarField, true);
+ Date nextDate = nextCal.getTime();
+ if (end != null)
+ if (end.compareTo(nextDate) < 0)
+ return null;
+ return nextDate;
+ }
+
+ /**
+ * Returns the previous date in the sequence, or null
if the
+ * next date is equal to or past the end limit.
+ * @return a Date object, or null
.
+ */
+ public Object getPreviousValue()
+ {
+ Calendar prevCal = Calendar.getInstance();
+ prevCal.setTime(date.getTime());
+ prevCal.roll(calendarField, false);
+ Date prevDate = prevCal.getTime();
+ if (end != null)
+ if (end.compareTo(prevDate) > 0)
+ return null;
+ return prevDate;
+ }
+
+ /**
+ * Sets the date field to change. It must be a valid Calendar field,
+ * excluding Calendar.ZONE_OFFSET and Calendar.DST_OFFSET.
+ * @param calendarField - the calendar field to set.
+ */
+ public void setCalendarField(int calendarField)
+ {
+ if (calendarField < 0 || calendarField >= Calendar.FIELD_COUNT
+ || calendarField == Calendar.ZONE_OFFSET
+ || calendarField == Calendar.DST_OFFSET)
+ throw new IllegalArgumentException("Illegal calendarField");
+
+ if (this.calendarField != calendarField)
+ {
+ this.calendarField = calendarField;
+ fireStateChanged();
+ }
+ }
+
+ /**
+ * Sets the starting date limit for the sequence.
+ *
+ * @param start - a Date object of the limit date,
+ * or null
for no limit.
+ */
+ public void setStart(Comparable start)
+ {
+ if (this.start != start)
+ {
+ this.start = start;
+ fireStateChanged();
+ }
+ }
+
+ /**
+ * Sets the end date limit for the sequence.
+ *
+ * @param end - a Date object of the limit date,
+ * or null
for no limit.
+ */
+ public void setEnd(Comparable end)
+ {
+ if (this.end != end)
+ {
+ this.end = end;
+ fireStateChanged();
+ }
+ }
+
+ /**
+ * Sets the current date in the sequence.
+ *
+ * @param value - a Date object.
+ */
+ public void setValue(Object value)
+ {
+ if (! (value instanceof Date) || value == null)
+ throw new IllegalArgumentException("Value not a date.");
+ date.setTime((Date) value);
+ fireStateChanged();
+ }
+}
Index: javax/swing/SwingUtilities.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/SwingUtilities.java,v
retrieving revision 1.15.2.6
diff -u -3 -p -u -r1.15.2.6 SwingUtilities.java
--- javax/swing/SwingUtilities.java 29 Jan 2005 02:45:23 -0000 1.15.2.6
+++ javax/swing/SwingUtilities.java 15 Feb 2005 20:55:25 -0000
@@ -42,7 +42,6 @@ import java.applet.Applet;
import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Container;
-import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Frame;
import java.awt.Graphics;
@@ -51,7 +50,6 @@ import java.awt.KeyboardFocusManager;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
-import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
Index: javax/swing/ViewportLayout.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/ViewportLayout.java,v
retrieving revision 1.10.2.1
diff -u -3 -p -u -r1.10.2.1 ViewportLayout.java
--- javax/swing/ViewportLayout.java 16 Jan 2005 15:15:13 -0000 1.10.2.1
+++ javax/swing/ViewportLayout.java 15 Feb 2005 20:55:25 -0000
@@ -63,17 +63,25 @@ public class ViewportLayout implements L
public void removeLayoutComponent(Component c)
{
}
+
public Dimension preferredLayoutSize(Container parent)
{
JViewport vp = (JViewport)parent;
Component view = vp.getView();
- return view.getPreferredSize();
+ if (view != null)
+ return view.getPreferredSize();
+ else
+ return new Dimension();
}
+
public Dimension minimumLayoutSize(Container parent)
{
JViewport vp = (JViewport)parent;
Component view = vp.getView();
- return view.getMinimumSize();
+ if (view != null)
+ return view.getMinimumSize();
+ else
+ return new Dimension();
}
/**
@@ -113,6 +121,9 @@ public class ViewportLayout implements L
JViewport port = (JViewport) parent;
Component view = port.getView();
+ if (view == null)
+ return;
+
// These dimensions and positions are in *view space*. Do not mix
// variables in here from port space (eg. parent.getBounds()). This
// function should be entirely in view space, because the methods on
Index: javax/swing/plaf/basic/BasicComboBoxEditor.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicComboBoxEditor.java,v
retrieving revision 1.2.2.2
diff -u -3 -p -u -r1.2.2.2 BasicComboBoxEditor.java
--- javax/swing/plaf/basic/BasicComboBoxEditor.java 15 Jan 2005 17:02:21 -0000 1.2.2.2
+++ javax/swing/plaf/basic/BasicComboBoxEditor.java 15 Feb 2005 20:55:25 -0000
@@ -46,7 +46,6 @@ import java.awt.event.FocusListener;
import javax.swing.ComboBoxEditor;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
-import javax.swing.plaf.UIResource;
/**
* This is a component that is responsible for displaying/editting selected
Index: javax/swing/plaf/basic/BasicComboBoxRenderer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicComboBoxRenderer.java,v
retrieving revision 1.2.2.2
diff -u -3 -p -u -r1.2.2.2 BasicComboBoxRenderer.java
--- javax/swing/plaf/basic/BasicComboBoxRenderer.java 15 Jan 2005 17:02:21 -0000 1.2.2.2
+++ javax/swing/plaf/basic/BasicComboBoxRenderer.java 15 Feb 2005 20:55:25 -0000
@@ -50,7 +50,6 @@ import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
-import javax.swing.plaf.UIResource;
/**
* This class is renderer for the combo box.
Index: javax/swing/tree/DefaultMutableTreeNode.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/tree/DefaultMutableTreeNode.java,v
retrieving revision 1.5.2.2
diff -u -3 -p -u -r1.5.2.2 DefaultMutableTreeNode.java
--- javax/swing/tree/DefaultMutableTreeNode.java 29 Jan 2005 02:45:23 -0000 1.5.2.2
+++ javax/swing/tree/DefaultMutableTreeNode.java 15 Feb 2005 20:55:25 -0000
@@ -46,7 +46,6 @@ import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.Random;
import java.util.Stack;
import java.util.Vector;
@@ -87,7 +86,8 @@ public class DefaultMutableTreeNode
protected boolean allowsChildren;
/**
- * Constructor DefaultMutableTreeNode
+ * Creates a DefaultMutableTreeNode
object.
+ * This node allows to add child nodes.
*/
public DefaultMutableTreeNode()
{
@@ -95,9 +95,10 @@ public class DefaultMutableTreeNode
}
/**
- * Constructor DefaultMutableTreeNode
+ * Creates a DefaultMutableTreeNode
object with the given
+ * user object attached to it. This node allows to add child nodes.
*
- * @param userObject TODO
+ * @param userObject the user object
*/
public DefaultMutableTreeNode(Object userObject)
{
@@ -105,10 +106,12 @@ public class DefaultMutableTreeNode
}
/**
- * Constructor DefaultMutableTreeNode
+ * Creates a DefaultMutableTreeNode
object with the given
+ * user object attached to it.
*
- * @param userObject TODO
- * @param allowsChildren TODO
+ * @param userObject the user object
+ * @param allowsChildren true
if the code allows to add child
+ * nodes, false
otherwise
*/
public DefaultMutableTreeNode(Object userObject, boolean allowsChildren)
{
@@ -136,9 +139,9 @@ public class DefaultMutableTreeNode
}
/**
- * toString
+ * Returns a string representation of this node
*
- * @return String
+ * @return a human-readable String representing this node
*/
public String toString()
{
@@ -149,9 +152,9 @@ public class DefaultMutableTreeNode
}
/**
- * add
+ * Adds a new child node to this node.
*
- * @param child TODO
+ * @param child the child node
*
* @throws IllegalArgumentException if child
is null
* @throws IllegalStateException if the node does not allow children
@@ -169,9 +172,9 @@ public class DefaultMutableTreeNode
}
/**
- * getParent
+ * Returns the parent node of this node.
*
- * @return TreeNode
+ * @return the parent node
*/
public TreeNode getParent()
{
@@ -179,9 +182,9 @@ public class DefaultMutableTreeNode
}
/**
- * remove
+ * Removes the child with the given index from this node
*
- * @param index TODO
+ * @param index the index
*/
public void remove(int index)
{
@@ -189,9 +192,9 @@ public class DefaultMutableTreeNode
}
/**
- * remove
+ * Removes the given child from this node.
*
- * @param node TODO
+ * @param node the child node
*/
public void remove(MutableTreeNode node)
{
@@ -201,7 +204,7 @@ public class DefaultMutableTreeNode
/**
* writeObject
*
- * @param stream TODO
+ * @param stream the output stream
*
* @exception IOException If an error occurs
*/
@@ -214,7 +217,7 @@ public class DefaultMutableTreeNode
/**
* readObject
*
- * @param stream TODO
+ * @param stream the input stream
*
* @exception IOException If an error occurs
* @exception ClassNotFoundException TODO
@@ -226,10 +229,10 @@ public class DefaultMutableTreeNode
}
/**
- * insert
+ * Inserts given child node at the given index.
*
- * @param node TODO
- * @param value TODO
+ * @param node the child node
+ * @param value the index.
*/
public void insert(MutableTreeNode node, int index)
{
@@ -237,7 +240,7 @@ public class DefaultMutableTreeNode
}
/**
- * getPath
+ * Returns a path to this node from the root.
*
* @return an array of tree nodes
*/
@@ -247,7 +250,8 @@ public class DefaultMutableTreeNode
}
/**
- * children
+ * Returns an enumeration containing all children of this node.
+ * EMPTY_ENUMERATION
is returned if this node has no children.
*
* @return an enumeration of tree nodes
*/
@@ -260,9 +264,9 @@ public class DefaultMutableTreeNode
}
/**
- * setParent
+ * Set the parent node for this node.
*
- * @param node TODO
+ * @param node the parent node
*/
public void setParent(MutableTreeNode node)
{
@@ -270,11 +274,11 @@ public class DefaultMutableTreeNode
}
/**
- * getChildAt
+ * Returns the child node at a given index.
*
- * @param index TODO
+ * @param index the index
*
- * @return TreeNode
+ * @return the child node
*/
public TreeNode getChildAt(int index)
{
@@ -282,9 +286,9 @@ public class DefaultMutableTreeNode
}
/**
- * getChildCount
+ * Returns the number of children of this node.
*
- * @return int
+ * @return the number of children
*/
public int getChildCount()
{
@@ -292,11 +296,11 @@ public class DefaultMutableTreeNode
}
/**
- * getIndex
+ * Returns the child index for a given node.
*
- * @param node TODO
+ * @param node this node
*
- * @return int
+ * @return the index
*/
public int getIndex(TreeNode node)
{
@@ -324,9 +328,9 @@ public class DefaultMutableTreeNode
}
/**
- * setUserObject
+ * Sets the user object for this node
*
- * @param userObject TODO
+ * @param userObject the user object
*/
public void setUserObject(Object userObject)
{
@@ -334,9 +338,10 @@ public class DefaultMutableTreeNode
}
/**
- * getUserObject
+ * Returns the user object attached to this node. null
is
+ * returned when no user object is set.
*
- * @return Object
+ * @return the user object
*/
public Object getUserObject()
{
@@ -344,15 +349,16 @@ public class DefaultMutableTreeNode
}
/**
- * removeFromParent
+ * Removes this node from its parent.
*/
public void removeFromParent()
{
+ // FIXME: IS this implementation really correct ?
parent = null;
}
/**
- * removeAllChildren
+ * Removes all child nodes from this node.
*/
public void removeAllChildren()
{
@@ -541,7 +547,7 @@ public class DefaultMutableTreeNode
}
TreeNode[] path = getPathToRoot(node.getParent(), depth + 1);
- path[depth] = node;
+ path[path.length - depth - 1] = node;
return path;
}
@@ -562,9 +568,9 @@ public class DefaultMutableTreeNode
}
/**
- * getRoot
+ * Returns the root node by iterating the parents of this node.
*
- * @return TreeNode
+ * @return the root node
*/
public TreeNode getRoot()
{
@@ -581,13 +587,14 @@ public class DefaultMutableTreeNode
}
/**
- * isRoot
+ * Tells whether this node is the root node or not.
*
- * @return boolean
+ * @return true
if this is the root node,
+ * false
otherwise
*/
public boolean isRoot()
{
- return (parent == null);
+ return parent == null;
}
/**
Index: javax/xml/parsers/DocumentBuilder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/xml/parsers/DocumentBuilder.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DocumentBuilder.java
--- javax/xml/parsers/DocumentBuilder.java 16 Jan 2005 15:15:14 -0000 1.1.2.1
+++ javax/xml/parsers/DocumentBuilder.java 15 Feb 2005 20:55:25 -0000
@@ -47,7 +47,6 @@ import org.w3c.dom.DOMImplementation;
import org.xml.sax.InputSource;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
Index: javax/xml/parsers/DocumentBuilderFactory.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/xml/parsers/DocumentBuilderFactory.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 DocumentBuilderFactory.java
--- javax/xml/parsers/DocumentBuilderFactory.java 16 Jan 2005 15:15:14 -0000 1.1.2.1
+++ javax/xml/parsers/DocumentBuilderFactory.java 15 Feb 2005 20:55:25 -0000
@@ -45,9 +45,6 @@ import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Properties;
import javax.xml.validation.Schema;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
/**
* Factory for obtaining document builders.
Index: javax/xml/transform/sax/SAXTransformerFactory.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/xml/transform/sax/SAXTransformerFactory.java,v
retrieving revision 1.1.2.1
diff -u -3 -p -u -r1.1.2.1 SAXTransformerFactory.java
--- javax/xml/transform/sax/SAXTransformerFactory.java 16 Jan 2005 15:15:14 -0000 1.1.2.1
+++ javax/xml/transform/sax/SAXTransformerFactory.java 15 Feb 2005 20:55:25 -0000
@@ -37,13 +37,10 @@ exception statement from your version. *
package javax.xml.transform.sax;
-import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
-import org.xml.sax.InputSource;
import org.xml.sax.XMLFilter;
/**
Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.63.2.6
diff -u -3 -p -u -r1.63.2.6 Makefile.am
--- lib/Makefile.am 31 Jan 2005 18:02:50 -0000 1.63.2.6
+++ lib/Makefile.am 15 Feb 2005 20:55:26 -0000
@@ -29,6 +29,10 @@ JAVAC = $(KJC) -classpath .:$(USER_CLASS
else
if FOUND_GCJX
JAVAC = $(GCJX) -classpath .:$(USER_CLASSLIB) -d . @classes
+else
+if FOUND_ECJ
+JAVAC = $(ECJ) -warn:-deprecation,serial -proceedOnError -bootclasspath '' -classpath $(compile_classpath) -d . @classes
+endif # FOUND_ECJ
endif # FOUND_GCJX
endif # FOUND_KJC
endif # FOUND_GCJ
Index: native/jni/classpath/native_state.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/classpath/native_state.c,v
retrieving revision 1.8
diff -u -3 -p -u -r1.8 native_state.c
--- native/jni/classpath/native_state.c 21 Jun 2004 19:35:37 -0000 1.8
+++ native/jni/classpath/native_state.c 15 Feb 2005 20:55:26 -0000
@@ -151,6 +151,7 @@ add_node (struct state_node **head, jint
{
back_ptr->next = node->next;
node->next = *head;
+ *head = node;
}
node->c_state = state;
return;
Index: native/jni/gtk-peer/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/Makefile.am,v
retrieving revision 1.12.2.4
diff -u -3 -p -u -r1.12.2.4 Makefile.am
--- native/jni/gtk-peer/Makefile.am 16 Jan 2005 15:15:14 -0000 1.12.2.4
+++ native/jni/gtk-peer/Makefile.am 15 Feb 2005 20:55:26 -0000
@@ -3,7 +3,6 @@ pkglib_LTLIBRARIES = libgtkpeer.la
# Gtk/Cairo JNI sources.
if GTK_CAIRO
gtk_cairo_c_source_files = \
- gnu_java_awt_peer_gtk_GdkGlyphVector.c \
gnu_java_awt_peer_gtk_GdkGraphics2D.c
else
gtk_cairo_c_source_files =
@@ -11,7 +10,6 @@ endif
libgtkpeer_la_SOURCES = $(gtk_cairo_c_source_files) \
gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c \
- gnu_java_awt_peer_gtk_GdkFontMetrics.c \
gnu_java_awt_peer_gtk_GdkFontPeer.c \
gnu_java_awt_peer_gtk_GdkGraphics.c \
gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c \
Index: native/jni/gtk-peer/gdkfont.h
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gdkfont.h,v
retrieving revision 1.3.2.1
diff -u -3 -p -u -r1.3.2.1 gdkfont.h
--- native/jni/gtk-peer/gdkfont.h 15 Jan 2005 17:02:22 -0000 1.3.2.1
+++ native/jni/gtk-peer/gdkfont.h 15 Feb 2005 20:55:26 -0000
@@ -102,6 +102,21 @@ extern struct state_table *native_text_l
#define TEXT_METRICS_Y_ADVANCE 5
#define NUM_TEXT_METRICS 6
+#define NUM_GLYPH_METRICS 10
+
+#define GLYPH_LOG_X(i) (NUM_GLYPH_METRICS * (i) )
+#define GLYPH_LOG_Y(i) (NUM_GLYPH_METRICS * (i) + 1)
+#define GLYPH_LOG_WIDTH(i) (NUM_GLYPH_METRICS * (i) + 2)
+#define GLYPH_LOG_HEIGHT(i) (NUM_GLYPH_METRICS * (i) + 3)
+
+#define GLYPH_INK_X(i) (NUM_GLYPH_METRICS * (i) + 4)
+#define GLYPH_INK_Y(i) (NUM_GLYPH_METRICS * (i) + 5)
+#define GLYPH_INK_WIDTH(i) (NUM_GLYPH_METRICS * (i) + 6)
+#define GLYPH_INK_HEIGHT(i) (NUM_GLYPH_METRICS * (i) + 7)
+
+#define GLYPH_POS_X(i) (NUM_GLYPH_METRICS * (i) + 8)
+#define GLYPH_POS_Y(i) (NUM_GLYPH_METRICS * (i) + 9)
+
struct peerfont
{
PangoFont *font;
@@ -119,16 +134,6 @@ struct peerfont
void *graphics_resource;
};
-struct glyphvec
-{
- /* the GList is list of PangoGlyphItems, each of which is a pair of 1
- PangoItem and 1 PangoGlyphString. */
- GList *glyphitems;
- PangoFontDescription *desc;
- PangoFont *font;
- PangoContext *ctx;
-};
-
struct textlayout
{
PangoLayout *pango_layout;
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
===================================================================
RCS file: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
diff -N native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c 15 Jan 2005 17:02:22 -0000 1.9.2.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,115 +0,0 @@
-/* gdkfontmetrics.c
- Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-#include "gtkpeer.h"
-#include "gdkfont.h"
-
-#include "gnu_java_awt_peer_gtk_GdkFontMetrics.h"
-#include